| Total Complexity | 10 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 18 | class ActionState |
||
| 19 | { |
||
| 20 | const STATE_NEW = 'new'; |
||
| 21 | const STATE_FINISHED = 'finished'; |
||
| 22 | const STATE_FAILED = 'failed'; |
||
| 23 | |||
| 24 | /** @var string */ |
||
| 25 | protected $state; |
||
| 26 | |||
| 27 | private function __construct(string $state = self::STATE_NEW) |
||
| 28 | { |
||
| 29 | $this->state = $state; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function getName() |
||
| 35 | } |
||
| 36 | |||
| 37 | public function isNew() |
||
| 38 | { |
||
| 39 | return $this->state === self::STATE_NEW; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function isFinished() |
||
| 43 | { |
||
| 44 | return $this->state === self::STATE_FINISHED; |
||
| 45 | } |
||
| 46 | |||
| 47 | public static function new() |
||
| 48 | { |
||
| 49 | return new self(self::STATE_NEW); |
||
| 50 | } |
||
| 51 | |||
| 52 | public static function finished() |
||
| 55 | } |
||
| 56 | |||
| 57 | public static function failed() |
||
| 58 | { |
||
| 59 | return new self(self::STATE_FAILED); |
||
| 60 | } |
||
| 61 | |||
| 62 | public static function fromString(string $name) |
||
| 71 | } |
||
| 72 | } |
||
| 73 |