Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class PipeProcessor implements ProcessorInterface |
||
13 | { |
||
14 | /** |
||
15 | * {@inheritdoc} |
||
16 | */ |
||
17 | public function process(array $pipes, array $payload, callable $outlet = null) |
||
18 | { |
||
19 | $payload = $payload[0] ?? null; |
||
20 | |||
21 | foreach ($pipes as $pipe) { |
||
22 | $payload = $pipe($payload); |
||
23 | } |
||
24 | |||
25 | if ($outlet !== null) { |
||
26 | return $outlet($payload); |
||
27 | } |
||
28 | |||
29 | return $payload; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function clearCache() |
||
37 | |||
38 | } |
||
40 |