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