1 | <?php |
||
38 | class Config extends ContainerConfig |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * Modify container |
||
43 | * |
||
44 | * @param Container $di DESCRIPTION |
||
45 | * |
||
46 | * @return mixed |
||
47 | * |
||
48 | * @access public |
||
49 | * |
||
50 | * @SuppressWarnings(PHPMD.ShortVariable) |
||
51 | */ |
||
52 | 4 | public function modify(Container $di) |
|
56 | |||
57 | /** |
||
58 | * Init |
||
59 | * |
||
60 | * @param Acl $acl DESCRIPTION |
||
61 | * |
||
62 | * @return mixed |
||
63 | * |
||
64 | * @access protected |
||
65 | */ |
||
66 | 4 | protected function init(Acl $acl) |
|
70 | } |
||
71 |
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: