| Conditions | 5 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function destruct(): void |
||
| 13 | { |
||
| 14 | $class = new \ReflectionClass($this); |
||
| 15 | foreach ($class->getProperties() as $property) { |
||
| 16 | $name = $property->getName(); |
||
| 17 | if (!isset($this->$name)) { |
||
| 18 | continue; |
||
| 19 | } |
||
| 20 | $value = $this->$name; |
||
| 21 | unset($this->$name); |
||
| 22 | if (\is_object($value) && \method_exists($value, 'destruct')) { |
||
| 23 | $value->destruct(); |
||
| 24 | } |
||
| 28 |