Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 16 |
Ratio | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | View Code Duplication | public function getClassOptions() |
|
33 | { |
||
34 | $annotation = $this->_reflector->getAnnotation('jobbers'); |
||
35 | |||
36 | if (!$annotation) { |
||
37 | return []; |
||
38 | } |
||
39 | |||
40 | foreach ($annotation as $option => $value) { |
||
41 | if (!in_array($option, self::ALLOWED_METHOD_OPTIONS)) { |
||
42 | throw new \Exception("option [$option] unknown"); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | return (array)$annotation; |
||
47 | } |
||
48 | |||
66 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: