summaryrefslogtreecommitdiff
path: root/includes/model/ShiftSignupState.php
diff options
context:
space:
mode:
authorBot <bot@myigel.name>2017-01-03 03:22:48 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-03 03:22:48 +0100
commit356b2582f3e6a43ecf2607acad4a7fe0b37f659a (patch)
treee02c9214b23a0b9ec33aa725db962d565bd30a82 /includes/model/ShiftSignupState.php
parentd71e7bbfad2f07f82df0c515608996d250fd4182 (diff)
PPHDoc, formatting, fixes, cleanup
Diffstat (limited to 'includes/model/ShiftSignupState.php')
-rw-r--r--includes/model/ShiftSignupState.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/includes/model/ShiftSignupState.php b/includes/model/ShiftSignupState.php
index d5c7f457..9b3de496 100644
--- a/includes/model/ShiftSignupState.php
+++ b/includes/model/ShiftSignupState.php
@@ -8,7 +8,6 @@ namespace Engelsystem;
*/
class ShiftSignupState
{
-
/**
* Shift has free places
*/
@@ -44,10 +43,18 @@ class ShiftSignupState
*/
const SIGNED_UP = 'SIGNED_UP';
+ /** @var string */
private $state;
+ /** @var int */
private $freeEntries;
+ /**
+ * ShiftSignupState constructor.
+ *
+ * @param string $state
+ * @param int $free_entries
+ */
public function __construct($state, $free_entries)
{
$this->state = $state;
@@ -69,6 +76,10 @@ class ShiftSignupState
}
}
+ /**
+ * @param string $state
+ * @return int
+ */
private function valueForState($state)
{
switch ($state) {
@@ -88,11 +99,15 @@ class ShiftSignupState
case ShiftSignupState::OCCUPIED:
case ShiftSignupState::ADMIN:
return 60;
+ default:
+ return 0;
}
}
/**
* Returns true, if signup is allowed
+ *
+ * @return bool
*/
public function isSignupAllowed()
{
@@ -106,6 +121,8 @@ class ShiftSignupState
/**
* Return the shift signup state
+ *
+ * @return string
*/
public function getState()
{
@@ -114,6 +131,8 @@ class ShiftSignupState
/**
* How many places are free in this shift for the angeltype?
+ *
+ * @return int
*/
public function getFreeEntries()
{