| Conditions | 4 |
| Paths | 5 |
| Total Lines | 29 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function extract( |
||
| 16 | $element |
||
| 17 | ) |
||
| 18 | { |
||
| 19 | $return = []; |
||
| 20 | $reflection = new \ReflectionClass($element); |
||
| 21 | $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC); |
||
| 22 | $defaultValues = $reflection->getDefaultProperties(); |
||
| 23 | foreach ($properties as $property) { |
||
| 24 | $value = '<empty>'; |
||
| 25 | if (isset($defaultValues[$property->getName()])) { |
||
| 26 | $value = $defaultValues[$property->getName()]; |
||
| 27 | } |
||
| 28 | if ($property->getDocComment()) { |
||
| 29 | $option = new Property( |
||
| 30 | $property->getName(), |
||
| 31 | $value, |
||
| 32 | $property->getDocComment() |
||
| 33 | ); |
||
| 34 | } else { |
||
| 35 | $option = new Property( |
||
| 36 | $property->getName(), |
||
| 37 | $value |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | $return[] = $option; |
||
| 41 | } |
||
| 42 | return $return; |
||
| 43 | } |
||
| 44 | |||
| 45 | } |