Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 16 |
Ratio | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
49 | View Code Duplication | public function getMethodOptions($method) |
|
50 | { |
||
51 | $annotation = $this->_reflector->getMethod($method)->getAnnotation('jobbers'); |
||
52 | |||
53 | if (!$annotation) { |
||
54 | return []; |
||
55 | } |
||
56 | |||
57 | foreach ($annotation as $option => $value) { |
||
58 | if (!in_array($option, self::ALLOWED_METHOD_OPTIONS)) { |
||
59 | throw new \Exception("option [$option] unknown"); |
||
60 | } |
||
61 | } |
||
62 | |||
63 | return (array)$annotation; |
||
64 | } |
||
65 | |||
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: