| Total Complexity | 5 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | abstract class StateMethods extends Methods |
||
| 8 | { |
||
| 9 | |||
| 10 | const OFFLINE = 0; |
||
| 11 | const ONLINE = 1; |
||
| 12 | const AWAY = 2; |
||
| 13 | const BUSY = 3; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * State: |
||
| 17 | * 0 "offline" offline |
||
| 18 | * 1 "online" online |
||
| 19 | * 2 "away" absent (can receive calls, but shan't receive messages) |
||
| 20 | * 3 "busy" busy (can receive messages, but shan’t receive calls) |
||
| 21 | * @var integer |
||
| 22 | */ |
||
| 23 | public $state; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * User message. |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | public $note; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Set state online |
||
| 33 | */ |
||
| 34 | public function online() |
||
| 35 | { |
||
| 36 | $this->state = self::ONLINE; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Set state offline |
||
| 41 | */ |
||
| 42 | public function offline() |
||
| 43 | { |
||
| 44 | $this->state = self::OFFLINE; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Set state away |
||
| 49 | */ |
||
| 50 | public function away() |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Set state busy |
||
| 57 | */ |
||
| 58 | public function busy() |
||
| 59 | { |
||
| 60 | $this->state = self::BUSY; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Set Mandatory Fields for all methods |
||
| 65 | * @return array |
||
| 66 | */ |
||
| 67 | public function getMandatoryFields(): array |
||
| 70 | } |
||
| 71 | } |
||
| 72 |