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