| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public static function getMetadataFactory($serializer) |
||
| 17 | { |
||
| 18 | if (method_exists($serializer, "getMetadataFactory")) { |
||
| 19 | // JMS Serializer 1.x |
||
| 20 | return $serializer->getMetadataFactory(); |
||
| 21 | } else { |
||
| 22 | // JMS Serializer 2.x & 3.x |
||
| 23 | $reflectionProperty = new \ReflectionProperty(get_class($serializer), 'factory'); |
||
| 24 | $reflectionProperty->setAccessible(true); |
||
| 25 | return $reflectionProperty->getValue($serializer); |
||
| 26 | } |
||
| 29 |