Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | protected function configureResourceNode(ArrayNodeDefinition $resourceNode) |
||
33 | { |
||
34 | $resourceNode |
||
|
|||
35 | ->children() |
||
36 | ->scalarNode('first_name')->cannotBeEmpty()->end() |
||
37 | ->scalarNode('last_name')->cannotBeEmpty()->end() |
||
38 | ->scalarNode('phone_number')->end() |
||
39 | ->scalarNode('company')->end() |
||
40 | ->scalarNode('street')->cannotBeEmpty()->end() |
||
41 | ->scalarNode('city')->cannotBeEmpty()->end() |
||
42 | ->scalarNode('postcode')->cannotBeEmpty()->end() |
||
43 | ->scalarNode('country_code')->cannotBeEmpty()->end() |
||
44 | ->scalarNode('province_code')->end() |
||
45 | ->scalarNode('province_name')->end() |
||
46 | ->scalarNode('customer')->cannotBeEmpty()->end() |
||
47 | ; |
||
48 | } |
||
49 | } |
||
50 |
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: