Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
64 | private function callableForNextRule(int $index): \Closure |
||
65 | { |
||
66 | if (!isset($this->rules[$index])) { |
||
67 | return function (ClientId $clientId, DataBag $commandParameters, DataBag $validatedParameters): DataBag { |
||
68 | return $validatedParameters; |
||
69 | }; |
||
70 | } |
||
71 | $rule = $this->rules[$index]; |
||
72 | |||
73 | return function (ClientId $clientId, DataBag $commandParameters, DataBag $validatedParameters) use ($rule, $index): DataBag { |
||
74 | return $rule->handle($clientId, $commandParameters, $validatedParameters, $this->callableForNextRule($index + 1)); |
||
75 | }; |
||
76 | } |
||
77 | } |
||
78 |