| 1 | <?php |
||
| 5 | class ProxyAccessor |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | private $proxyName; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var ClassMetadata |
||
| 14 | */ |
||
| 15 | private $classmetadata; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $originalClassName; |
||
| 21 | |||
| 22 | public function __construct(ClassMetadata $classMetadata) |
||
| 28 | |||
| 29 | public function loadClass(ClassMetadata $class2) |
||
| 38 | |||
| 39 | private function evalClass(ClassMetadata $class) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param ClassMetadata $class2 |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function getCanonicalClassName(ClassMetadata $class2) |
||
| 58 | |||
| 59 | public function load() |
||
| 72 | } |
||
| 73 |
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: