| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function applyToNode(Node $node) |
||
| 26 | { |
||
| 27 | $ref = $node->getInstruction($this); |
||
| 28 | $check = $this->getByReference($ref, $this->source, $this->target); |
||
| 29 | |||
| 30 | if (!isset($check)) { |
||
| 31 | $node->setResult(null); |
||
| 32 | |||
| 33 | foreach ($node as $prop => $value) { |
||
|
|
|||
| 34 | unset($node->$prop); // Remove all other properties, including processing instructions |
||
| 35 | } |
||
| 36 | } else { |
||
| 37 | $result = $node->getResult(); |
||
| 38 | unset($result->{$this->property}); |
||
| 39 | |||
| 40 | $node->setResult($result); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 |