| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3.0052 |
| Changes | 4 | ||
| Bugs | 2 | Features | 2 |
| 1 | <?php |
||
| 12 | 2 | public static function getAnnotations($class, $value) |
|
| 13 | { |
||
| 14 | 2 | $propertyReflect = new \ReflectionProperty($class, $value); |
|
| 15 | 2 | $doc = $propertyReflect->getDocComment(); |
|
| 16 | 2 | if (!preg_match_all('#@(.*?)\n#s', $doc, $annotations)) { |
|
| 17 | return false; |
||
| 18 | } |
||
| 19 | 2 | $annotations = $annotations[1]; |
|
| 20 | 2 | $return = []; |
|
| 21 | 2 | foreach ($annotations as $annotation) { |
|
| 22 | 2 | list($k, $v) = array_pad(explode(' ', $annotation, 2), 2, null); |
|
| 23 | 2 | $return[$k] = $v; |
|
| 24 | 2 | } |
|
| 25 | |||
| 26 | 2 | return $return; |
|
| 27 | } |
||
| 28 | } |
||
| 29 |