| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | public function load() |
||
| 60 | { |
||
| 61 | $this->evalClass($this->classmetadata); |
||
| 62 | |||
| 63 | $builder = new ProxyBuilder(); |
||
| 64 | $builder->setNamespace($this->classmetadata->getNamespace()); |
||
| 65 | $builder->setClassName($this->originalClassName); |
||
| 66 | $builder->setParentClass("\\" . $this->classmetadata->getNamespace() . "\\" . $this->classmetadata->getName()); |
||
| 67 | foreach ($this->classmetadata->getMethods() as $method) { |
||
| 68 | $builder->addMethod($method); |
||
| 69 | } |
||
| 70 | $builder->loadProxy(); |
||
|
|
|||
| 71 | } |
||
| 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: