| Conditions | 4 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 5 | public function create(ReflectionClass $reflectionClass): ReflectionPropertySet |
|
| 31 | { |
||
| 32 | 5 | $properties = new ReflectionPropertySet(); |
|
| 33 | 5 | foreach ($reflectionClass->getProperties() as $reflectionProperty) { |
|
| 34 | 4 | $properties->add($reflectionProperty); |
|
| 35 | } |
||
| 36 | |||
| 37 | 5 | $parentClass = $reflectionClass->getParentClass(); |
|
| 38 | |||
| 39 | 5 | while (false !== $parentClass) { |
|
| 40 | // add all private properties from parent |
||
| 41 | 4 | foreach ($parentClass->getProperties(ReflectionProperty::IS_PRIVATE) as $property) { |
|
| 42 | 1 | $properties->add($property); |
|
| 43 | } |
||
| 44 | |||
| 45 | // reset $parentClass |
||
| 46 | 4 | $parentClass = $parentClass->getParentClass(); |
|
| 47 | } |
||
| 48 | |||
| 49 | 5 | return $properties; |
|
| 50 | } |
||
| 52 |