Use is_subclass_of instead of Reflection when possible

This commit is contained in:
Ener-Getick 2016-01-16 14:42:15 +01:00
parent 7d72f93e90
commit 51e3652aeb

View File

@ -59,8 +59,6 @@ class CustomNormalizer extends SerializerAwareNormalizer implements NormalizerIn
*/
public function supportsDenormalization($data, $type, $format = null)
{
$class = new \ReflectionClass($type);
return $class->isSubclassOf('Symfony\Component\Serializer\Normalizer\DenormalizableInterface');
return is_subclass_of($type, 'Symfony\Component\Serializer\Normalizer\DenormalizableInterface');
}
}