| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function __construct(JobInterface $job, string $newState, array $allowedStates = []) |
||
| 27 | { |
||
| 28 | $msg = sprintf('The Job(id = %d) cannot change from "%s" to "%s". Allowed transitions: ', $job->getId(), $job->getState(), $newState); |
||
| 29 | $msg .= count($allowedStates) > 0 ? '"' . implode('", "', $allowedStates) . '"' : '#none#'; |
||
| 30 | parent::__construct($msg); |
||
| 31 | |||
| 32 | $this->job = $job; |
||
| 33 | $this->newState = $newState; |
||
| 34 | $this->allowedStates = $allowedStates; |
||
| 35 | } |
||
| 61 |