| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | protected function extractObjectData($value, $ref, $properties): array |
||
| 35 | { |
||
| 36 | $data = []; |
||
| 37 | foreach ($properties as $property) { |
||
| 38 | if (in_array($property, self::SKIP_PROPERTIES, true)) { |
||
| 39 | continue; |
||
| 40 | } |
||
| 41 | |||
| 42 | try { |
||
| 43 | $propRef = $ref->getProperty($property); |
||
| 44 | $propRef->setAccessible(true); |
||
| 45 | $data[$property] = $propRef->getValue($value); |
||
| 46 | } catch (ReflectionException) { |
||
| 47 | $data[$property] = $value->$property; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | return $data; |
||
| 52 | } |
||
| 54 |