1 | <?php |
||
15 | class Http implements Processor |
||
16 | { |
||
17 | /** |
||
18 | * Property key which should trigger the processor |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $property; |
||
22 | |||
23 | /** |
||
24 | * Class constructor |
||
25 | * |
||
26 | * @param DataEnricher $invoker |
||
27 | * @param string $property Property key with the processing instruction |
||
28 | */ |
||
29 | public function __construct(DataEnricher $invoker, $property) |
||
33 | |||
34 | /** |
||
35 | * Get the property key that holds the processing instruction |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getProperty() |
||
43 | |||
44 | /** |
||
45 | * Apply processing to nodes |
||
46 | * |
||
47 | * @param Node[] $nodes |
||
48 | */ |
||
49 | public function applyTo(array $nodes) |
||
58 | |||
59 | /** |
||
60 | * Do async requests for each node |
||
61 | * |
||
62 | * @param Node[] $nodes |
||
63 | * @return \SplObjectStorage|Promise\PromiseInterface[] |
||
64 | */ |
||
65 | protected function request($nodes) |
||
79 | |||
80 | /** |
||
81 | * Apply results to nodes |
||
82 | * |
||
83 | * @param \SplObjectStorage|Promise\PromiseInterface[] $promises |
||
84 | */ |
||
85 | protected function applyResults($promises) |
||
107 | |||
108 | /** |
||
109 | * Check if we got an expected response |
||
110 | * |
||
111 | * @param Response $response |
||
112 | * @return boolean |
||
113 | */ |
||
114 | protected function hasExpectedResponse(Response $response) |
||
134 | } |
||
135 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.