1 | <?php |
||
10 | class Application |
||
11 | { |
||
12 | /** |
||
13 | * Create a new application |
||
14 | * |
||
15 | * @param Injector $injector |
||
16 | * @param ConfigurationSet $configuration |
||
17 | * @param MiddlewareSet $middleware |
||
18 | * |
||
19 | * @return static |
||
20 | */ |
||
21 | 2 | public static function build( |
|
28 | |||
29 | /** |
||
30 | * @var Injector |
||
31 | */ |
||
32 | private $injector; |
||
33 | |||
34 | /** |
||
35 | * @var ConfigurationSet |
||
36 | */ |
||
37 | private $configuration; |
||
38 | |||
39 | /** |
||
40 | * @var MiddlewareSet |
||
41 | */ |
||
42 | private $middleware; |
||
43 | |||
44 | /** |
||
45 | * @var callable|string |
||
46 | */ |
||
47 | private $routing; |
||
48 | |||
49 | /** |
||
50 | * @param Injector $injector |
||
51 | * @param ConfigurationSet $configuration |
||
52 | * @param MiddlewareSet $middleware |
||
53 | */ |
||
54 | 6 | public function __construct( |
|
63 | |||
64 | /** |
||
65 | * Change configuration values |
||
66 | * |
||
67 | * @param array $configuration |
||
68 | * |
||
69 | * @return self |
||
70 | */ |
||
71 | 2 | public function setConfiguration(array $configuration) |
|
76 | |||
77 | /** |
||
78 | * Change middleware |
||
79 | * |
||
80 | * @param array $middleware |
||
81 | * |
||
82 | * @return self |
||
83 | */ |
||
84 | 1 | public function setMiddleware(array $middleware) |
|
89 | |||
90 | /** |
||
91 | * Change routing |
||
92 | * |
||
93 | * @param callable|string $routing |
||
94 | * |
||
95 | * @return self |
||
96 | */ |
||
97 | 2 | public function setRouting($routing) |
|
102 | |||
103 | /** |
||
104 | * Run the application |
||
105 | * |
||
106 | * @param string $runner |
||
107 | * |
||
108 | * @return \Psr\Http\Message\ResponseInterface |
||
109 | */ |
||
110 | 1 | public function run($runner = 'Relay\Relay') |
|
119 | } |
||
120 |
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.