| 1 | <?php declare(strict_types = 1); |
||
| 12 | class Payload implements PayloadContract |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | private $input = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var |
||
| 22 | */ |
||
| 23 | private $output; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $status = ''; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Payload constructor. |
||
| 32 | * |
||
| 33 | * @param string $status |
||
| 34 | */ |
||
| 35 | 4 | public function __construct(string $status) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @inheritDoc |
||
| 42 | */ |
||
| 43 | 2 | public function getInput(): array |
|
| 47 | |||
| 48 | /** |
||
| 49 | * @inheritDoc |
||
| 50 | */ |
||
| 51 | 1 | public function getOutput() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @inheritDoc |
||
| 58 | */ |
||
| 59 | 1 | public function getStatus(): string |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Input setter. |
||
| 66 | * |
||
| 67 | * @param array $arguments |
||
| 68 | * @return PayloadContract |
||
| 69 | */ |
||
| 70 | 1 | public function withInput(array $arguments): PayloadContract |
|
| 77 | |||
| 78 | /** |
||
| 79 | * Output setter. |
||
| 80 | * |
||
| 81 | * @param $output |
||
| 82 | * @return PayloadContract |
||
| 83 | */ |
||
| 84 | 1 | public function withOutput($output): PayloadContract |
|
| 91 | |||
| 92 | |||
| 93 | } |
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.