Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Lines | 29 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
35 | View Code Duplication | public function runTwo($eloquentClasses) |
|
36 | { |
||
37 | |||
38 | |||
39 | $tables = (new Pipeline) |
||
40 | ->pipe(new DatabaseRender) |
||
41 | ->pipe(new DatabaseMount); |
||
42 | |||
43 | // Returns 21 |
||
44 | $entitys = $pipeline->process(10); |
||
45 | |||
46 | |||
47 | |||
48 | // Re-usable Pipelines |
||
49 | // Because the PipelineInterface is an extension of the StageInterface pipelines can be re-used as stages. This creates a highly composable model to create complex execution patterns while keeping the cognitive load low. |
||
50 | |||
51 | // For example, if we'd want to compose a pipeline to process API calls, we'd create something along these lines: |
||
52 | |||
53 | $databaseEntity = (new Pipeline) |
||
54 | ->pipe(new ExecuteHttpRequest) // 2 |
||
55 | ->pipe(new ParseJsonResponse); // 3 |
||
56 | |||
57 | $pipeline = (new Pipeline) |
||
58 | ->pipe(new ConvertToPsr7Request) // 1 |
||
59 | ->pipe($processApiRequest) // (2,3) |
||
60 | ->pipe(new ConvertToResponseDto); // 4 |
||
61 | |||
62 | $pipeline->process(new DeleteBlogPost($postId)); |
||
63 | } |
||
64 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.