| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 9 | public function __invoke($var) |
|
| 17 | { |
||
| 18 | 9 | $ref = new \ReflectionObject($var); |
|
| 19 | |||
| 20 | 9 | $result = []; |
|
| 21 | 9 | while($ref) { |
|
| 22 | 9 | foreach($ref->getProperties() as $property) { |
|
| 23 | 9 | if(\in_array($property->getName(), $this->skipped, true)) { |
|
| 24 | 3 | continue; |
|
| 25 | } |
||
| 26 | |||
| 27 | 9 | $property->setAccessible(true); |
|
| 28 | |||
| 29 | 9 | $result[$property->getName()] = $property->getValue($var); |
|
| 30 | } |
||
| 31 | |||
| 32 | 9 | $ref = $ref->getParentClass(); |
|
| 33 | } |
||
| 34 | |||
| 35 | 9 | return $result; |
|
| 36 | } |
||
| 37 | } |
||
| 38 |