1 | <?php namespace Comodojo\Dispatcher\Components; |
||
26 | trait DataAccess { |
||
27 | |||
28 | protected $data = array(); |
||
29 | |||
30 | 12 | public function __get($name) { |
|
31 | |||
32 | 12 | if ( array_key_exists($name, $this->data) ) { |
|
33 | |||
34 | 12 | return $this->data[$name]; |
|
35 | |||
36 | } |
||
37 | |||
38 | return null; |
||
39 | |||
40 | // $className = get_class($this); |
||
|
|||
41 | |||
42 | // throw new Exception("Invalid property $name for $className"); |
||
43 | |||
44 | } |
||
45 | |||
46 | 6 | public function __set($name, $value) { |
|
55 | |||
56 | 1 | public function __isset($name) { |
|
61 | |||
62 | public function merge($data) { |
||
71 | |||
72 | public function export() { |
||
77 | |||
78 | public function import($data) { |
||
85 | |||
86 | } |
||
87 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.