Total Complexity | 6 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class State |
||
11 | { |
||
12 | const TYPE_INITIAL = 'initial'; |
||
13 | |||
14 | const TYPE_NORMAL = 'normal'; |
||
15 | |||
16 | const TYPE_FINAL = 'final'; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $name; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $type; |
||
27 | |||
28 | /** |
||
29 | * State constructor. |
||
30 | * |
||
31 | * @param string $name |
||
32 | * @param string $type |
||
33 | */ |
||
34 | 16 | public function __construct($name, $type) |
|
35 | { |
||
36 | 16 | $this->name = $name; |
|
37 | 16 | $this->type = $type; |
|
38 | 16 | } |
|
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | 6 | public function getName(): string |
|
44 | { |
||
45 | 6 | return $this->name; |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 1 | public function getType(): string |
|
52 | { |
||
53 | 1 | return $this->type; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return bool |
||
58 | */ |
||
59 | 4 | public function isInitial(): bool |
|
60 | { |
||
61 | 4 | return self::TYPE_INITIAL === $this->type; |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return bool |
||
66 | */ |
||
67 | 4 | public function isNormal(): bool |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * @return bool |
||
74 | */ |
||
75 | 3 | public function isFinal(): bool |
|
78 | } |
||
79 | } |
||
80 |