| 1 | <?php |
||
| 10 | class ClosureUsePrinter |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var Dispatcher |
||
| 14 | */ |
||
| 15 | private $dispatcher = null; |
||
| 16 | /** |
||
| 17 | * @var Logger |
||
| 18 | */ |
||
| 19 | private $logger = null; |
||
| 20 | /** |
||
| 21 | * @var ReservedWordReplacer |
||
| 22 | */ |
||
| 23 | private $reservedWordReplacer = null; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param Dispatcher $dispatcher |
||
| 27 | * @param Logger $logger |
||
| 28 | * @param ReservedWordReplacer $reservedWordReplacer |
||
| 29 | */ |
||
| 30 | 1 | public function __construct(Dispatcher $dispatcher, Logger $logger, ReservedWordReplacer $reservedWordReplacer) |
|
| 36 | |||
| 37 | 1 | public static function getType() |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @param Expr\ClosureUse $node |
||
| 44 | * |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | 1 | public function convert(Expr\ClosureUse $node) |
|
| 59 | } |
||
| 60 |
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.