1 | <?php declare(strict_types=1); |
||
9 | class ServicesContainer |
||
10 | { |
||
11 | private $services = array(); |
||
|
|||
12 | private $patterns = array(); |
||
13 | private $factories = array(); |
||
14 | private $instantiatedFactories = array(); |
||
15 | private $renderer; |
||
16 | |||
17 | /** |
||
18 | * @throws DuplicatedServiceNameException |
||
19 | */ |
||
20 | 1 | public function __construct(array $config = []) |
|
26 | |||
27 | /** |
||
28 | * @throws DuplicatedServiceNameException |
||
29 | */ |
||
30 | private function registerFromConfig(array $config) |
||
38 | |||
39 | /** |
||
40 | * @throws DuplicatedServiceNameException |
||
41 | */ |
||
42 | 1 | public function registerService(string $serviceName, array $regex, callable $factory) |
|
57 | |||
58 | public function setRenderer(callable $rendererFactory) |
||
62 | |||
63 | public function getRenderer(): EmbedRendererInterface |
||
67 | |||
68 | 1 | public function getServiceNameList(): array |
|
72 | |||
73 | 1 | public function hasService($serviceName): bool |
|
77 | |||
78 | public function getServices(): array |
||
82 | |||
83 | public function getPatterns(): array |
||
87 | |||
88 | public function getFactory($serviceName): CallableServiceAdapterFactoryInterface |
||
97 | } |
||
98 |
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.