Total Complexity | 4 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | abstract class Pipe |
||
9 | { |
||
10 | /** |
||
11 | * Task that is currently processing. |
||
12 | * |
||
13 | * @var Task |
||
14 | */ |
||
15 | protected $task; |
||
16 | |||
17 | /** |
||
18 | * Get the pipe name. |
||
19 | * |
||
20 | * @return string |
||
21 | */ |
||
22 | public function name() |
||
23 | { |
||
24 | return basename( |
||
25 | str_replace('\\', '/', static::class) |
||
26 | ); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Call pipe handler and detect any errors. |
||
31 | * |
||
32 | * @param array $payload |
||
33 | * @param \Closure $next |
||
34 | * |
||
35 | * @throws PipelineTaskFailedException |
||
36 | * |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function process(array $payload, \Closure $next) |
||
61 | ); |
||
62 | } |
||
64 |