1 | <?php |
||
14 | class DumperDependencyProvider extends AbstractProvider |
||
15 | { |
||
16 | const DOCKER_FACADE = 'docker.facade'; |
||
17 | const SHELL_FACADE = 'shell.facade'; |
||
18 | const COMMAND_LIST = 'command.list'; |
||
19 | |||
20 | /** |
||
21 | * @param \Xervice\Core\Dependency\DependencyProviderInterface $container |
||
22 | */ |
||
23 | public function handleDependencies(DependencyProviderInterface $container) |
||
32 | |||
33 | /** |
||
34 | * @return array |
||
35 | */ |
||
36 | protected function getCommandList() |
||
42 | |||
43 | /** |
||
44 | * @param \Xervice\Core\Dependency\DependencyProviderInterface $container |
||
45 | */ |
||
46 | private function addShellFacade(DependencyProviderInterface $container): void |
||
52 | |||
53 | /** |
||
54 | * @param \Xervice\Core\Dependency\DependencyProviderInterface $container |
||
55 | */ |
||
56 | private function addDockerFacade(DependencyProviderInterface $container): void |
||
62 | } |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: