Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 0 |
1 | <?php |
||
29 | 70 | private function createPluginChain($pluginList) |
|
30 | { |
||
31 | $lastCallable = function () {}; // Last callable is a NO-OP |
||
32 | 70 | while ($plugin = array_pop($pluginList)) { |
|
33 | 70 | if (! $plugin instanceof ErrorHandlerPluginInterface) { |
|
34 | throw InvalidErrorHandlerPluginException::forPlugin($plugin); |
||
35 | } |
||
36 | 70 | $lastCallable = function ($error, ExecutionContext $executionContext) use ($plugin, $lastCallable) { |
|
37 | 19 | return $plugin->execute($error, $executionContext, $lastCallable); |
|
38 | 70 | }; |
|
39 | } |
||
40 | 70 | return $lastCallable; |
|
41 | } |
||
42 | } |
||
43 |