Conditions | 5 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
72 | public function can(StatefulInterface $stateful, array $parameters = []): bool |
||
73 | { |
||
74 | foreach ($this->fromStates as $state) { |
||
75 | if ($state->getName() === $stateful->getState()) { |
||
76 | if (!is_null($this->checker) && !(bool) call_user_func($this->checker, $stateful, $parameters)) { |
||
77 | return false; |
||
78 | } |
||
79 | |||
80 | return true; |
||
81 | } |
||
82 | } |
||
83 | |||
84 | return false; |
||
85 | } |
||
87 |