Conditions | 5 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
43 | public function __unset($name) |
||
44 | { |
||
45 | $registry = Registry::get($this); |
||
46 | |||
47 | $reflection = new \ReflectionClass($this); |
||
48 | |||
49 | if ($registry->has($name) && $reflection->hasProperty($name)) { |
||
50 | $property = $reflection->getProperty($name); |
||
51 | |||
52 | if ($property->isProtected() || $property->isPublic()) { |
||
53 | unset($this->$name); |
||
54 | return true; |
||
55 | } |
||
56 | |||
57 | } |
||
58 | |||
59 | return false; |
||
60 | } |
||
61 | } |
||
62 |