Conditions | 4 |
Paths | 6 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function match(Transition $transition, Item $item, Context $context): bool |
||
32 | { |
||
33 | $localContext = $context->createCleanCopy(); |
||
34 | $success = true; |
||
35 | |||
36 | foreach ($this->conditions as $condition) { |
||
37 | if (!$condition->match($transition, $item, $localContext)) { |
||
38 | $success = false; |
||
39 | } |
||
40 | } |
||
41 | |||
42 | if (!$success) { |
||
43 | $context->addError( |
||
44 | 'transition.condition.and.failed', |
||
45 | [], |
||
46 | $localContext->getErrorCollection() |
||
47 | ); |
||
48 | } |
||
49 | |||
50 | return $success; |
||
51 | } |
||
52 | } |
||
53 |