Skip to content

Commit 5c034ad

Browse files
committed
minor symfony#17400 Use is_subclass_of instead of Reflection when possible (Ener-Getick)
This PR was merged into the 2.3 branch. Discussion ---------- Use is_subclass_of instead of Reflection when possible | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT For performance reason, I replaced a reflection instantiation by ``is_subclass_of`` Commits ------- 51e3652 Use is_subclass_of instead of Reflection when possible
2 parents 7d72f93 + 51e3652 commit 5c034ad

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/Serializer/Normalizer/CustomNormalizer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ public function supportsNormalization($data, $format = null)
5959
*/
6060
public function supportsDenormalization($data, $type, $format = null)
6161
{
62-
$class = new \ReflectionClass($type);
63-
64-
return $class->isSubclassOf('Symfony\Component\Serializer\Normalizer\DenormalizableInterface');
62+
return is_subclass_of($type, 'Symfony\Component\Serializer\Normalizer\DenormalizableInterface');
6563
}
6664
}

0 commit comments

Comments
 (0)