Parcourir la source

applied is_subclass_of fix to handlers pass

Johannes M. Schmitt il y a 12 ans
Parent
commit
54d9df230c
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      DependencyInjection/Compiler/CustomHandlersPass.php

+ 2 - 1
DependencyInjection/Compiler/CustomHandlersPass.php

@@ -38,7 +38,8 @@ class CustomHandlersPass implements CompilerPassInterface
 
 
         foreach ($container->findTaggedServiceIds('jms_serializer.subscribing_handler') as $id => $tags) {
         foreach ($container->findTaggedServiceIds('jms_serializer.subscribing_handler') as $id => $tags) {
             $class = $container->getDefinition($id)->getClass();
             $class = $container->getDefinition($id)->getClass();
-            if ( ! is_subclass_of($class, 'JMS\SerializerBundle\Serializer\Handler\SubscribingHandlerInterface')) {
+            $ref = new \ReflectionClass($class);
+            if ( ! $ref->implementsInterface('JMS\SerializerBundle\Serializer\Handler\SubscribingHandlerInterface')) {
                 throw new \RuntimeException(sprintf('The service "%s" must implement the SubscribingHandlerInterface.', $id));
                 throw new \RuntimeException(sprintf('The service "%s" must implement the SubscribingHandlerInterface.', $id));
             }
             }