1 | <?php declare(strict_types = 1); |
||
15 | final class RequestRouteCollection implements RouteCollectionContract |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @var ServerRequestInterface |
||
20 | */ |
||
21 | private $request; |
||
22 | |||
23 | /** |
||
24 | * @var RouteCollectionContract |
||
25 | */ |
||
26 | private $routes; |
||
27 | |||
28 | /** |
||
29 | * RequestRouteCollection constructor. |
||
30 | * |
||
31 | * @param ServerRequestInterface $request |
||
32 | * @param RouteCollectionContract $routes |
||
33 | */ |
||
34 | 6 | public function __construct(ServerRequestInterface $request, RouteCollectionContract $routes) |
|
39 | |||
40 | /** |
||
41 | * @inheritDoc |
||
42 | */ |
||
43 | 1 | public function addGroup(RouteGroupContract $group): RouteCollectionContract |
|
49 | |||
50 | /** |
||
51 | * @inheritDoc |
||
52 | */ |
||
53 | 1 | public function addRoute(RouteContract $route): RouteCollectionContract |
|
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | */ |
||
63 | 2 | public function getRoutes(): array |
|
76 | |||
77 | } |
||
78 |
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.