Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
19 | 11 | public static function notAllowedTransition( |
|
20 | string $transition, |
||
21 | $context, |
||
22 | string $currentState |
||
23 | ): self { |
||
24 | 11 | if (\is_object($context)) { |
|
25 | 2 | $context = \get_class($context); |
|
26 | } |
||
27 | |||
28 | 11 | return new static( |
|
29 | 11 | \sprintf( |
|
30 | 11 | "The transition '%s' is not allowed when context '%s' is in state '%s'.", |
|
31 | 11 | $transition, |
|
32 | 11 | $context, |
|
33 | 11 | $currentState |
|
34 | ) |
||
38 |