| 1 | <?php  | 
            ||
| 19 | class AtomNode extends AbstractComponent  | 
            ||
| 20 | { | 
            ||
| 21 | protected $escapeOutput = false;  | 
            ||
| 22 | |||
| 23 | protected $file;  | 
            ||
| 24 | |||
| 25 | public function setName(?string $name): ComponentInterface  | 
            ||
| 30 | |||
| 31 | public function setFile($file): ComponentInterface  | 
            ||
| 36 | |||
| 37 | public function evaluate(RenderingContextInterface $renderingContext)  | 
            ||
| 44 | |||
| 45 | public function onOpen(RenderingContextInterface $renderingContext): ComponentInterface  | 
            ||
| 50 | }  | 
            ||
| 51 | 
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: