Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
58 | 1 | public function handle() |
|
59 | { |
||
60 | 1 | $errorController = $this->getErrorController(); |
|
61 | $errorController |
||
62 | 1 | ->setBootstrap($this->getBootstrap()) |
|
63 | 1 | ->setRequest($this->getRequest()) |
|
64 | 1 | ->setResponse($this->getResponse()) |
|
65 | 1 | ->setException($this->getException()); |
|
66 | 1 | $errorController->preFilter('index'); |
|
|
|||
67 | 1 | $errorController->indexAction(); |
|
68 | 1 | $errorController->postFilter('index'); |
|
69 | 1 | return $this; |
|
70 | } |
||
71 | } |
||
72 |
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: