Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
41 | 5 | private function createChain(): callable |
|
42 | { |
||
43 | 5 | $lastCallable = $this->clientCallable; |
|
44 | 5 | $reversedPlugins = array_reverse($this->plugins); |
|
45 | |||
46 | 5 | foreach ($reversedPlugins as $plugin) { |
|
47 | $lastCallable = function (RequestInterface $request) use ($plugin, $lastCallable) { |
||
48 | 1 | return $plugin->handleRequest($request, $lastCallable, $this); |
|
49 | 1 | }; |
|
50 | } |
||
51 | |||
52 | 5 | return $lastCallable; |
|
53 | } |
||
54 | |||
66 |