Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void |
||
22 | { |
||
23 | $resourceNode |
||
|
|||
24 | ->children() |
||
25 | ->scalarNode('title')->end() |
||
26 | ->scalarNode('name')->end() |
||
27 | ->scalarNode('body')->end() |
||
28 | ->scalarNode('meta_keywords')->end() |
||
29 | ->scalarNode('meta_description')->end() |
||
30 | ->booleanNode('publishable')->end() |
||
31 | ; |
||
32 | } |
||
33 | } |
||
34 |
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: