1 | <?php |
||
13 | class SwitchChoose implements Processor |
||
14 | { |
||
15 | use Processor\Implementation; |
||
16 | |||
17 | /** |
||
18 | * @var DotKey |
||
19 | */ |
||
20 | protected $source; |
||
21 | |||
22 | /** |
||
23 | * Class constructor |
||
24 | * |
||
25 | * @param DataEnricher $invoker |
||
26 | * @param string $property Property key which should trigger the processor |
||
27 | */ |
||
28 | public function __construct(DataEnricher $invoker, $property) |
||
33 | |||
34 | /** |
||
35 | * Apply processing to a single node |
||
36 | * |
||
37 | * @param Node $node |
||
38 | */ |
||
39 | public function applyToNode($node) |
||
47 | |||
48 | /** |
||
49 | * Choose on of the cases |
||
50 | * |
||
51 | * @param string $ref Property name of source |
||
52 | * @param object $cases |
||
53 | * @return type |
||
54 | */ |
||
55 | protected function choose($ref, $cases) |
||
60 | } |
||
61 |
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.