Conditions | 3 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function process(array $payload, \Closure $next) |
||
40 | { |
||
41 | /** |
||
42 | * @var Container $container |
||
43 | * @var Task $task |
||
44 | */ |
||
45 | list($container, $task) = $payload; |
||
46 | |||
47 | $this->task = $task; |
||
48 | |||
49 | try { |
||
50 | $result = $container->call([$this, 'handle']); |
||
51 | } catch (\Exception $e) { |
||
52 | throw PipelineTaskFailedException::exceptionThrown($this->name(), $e); |
||
53 | } |
||
54 | |||
55 | if ($result === false) { |
||
56 | throw PipelineTaskFailedException::rejected($this->name()); |
||
57 | } |
||
58 | |||
59 | return $next( |
||
60 | [$container, $task->setPipeResult($this->name(), $result)] |
||
61 | ); |
||
64 |