Conditions | 3 |
Paths | 5 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
77 | private function isConfigProperty($propertyName) |
||
78 | { |
||
79 | try { |
||
80 | $reflect = new \ReflectionClass($this); |
||
81 | $property = $reflect->getProperty($propertyName); |
||
82 | return $property->isPublic() && !$property->isStatic(); |
||
83 | } catch (\ReflectionException $e) { |
||
84 | return false; |
||
85 | } |
||
86 | |||
87 | } |
||
88 | } |
||
89 |
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: