瀏覽代碼

applied is_subclass_of fix to handlers pass

Johannes M. Schmitt 12 年之前
父節點
當前提交
54d9df230c
共有 1 個文件被更改,包括 2 次插入1 次删除
  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) {
             $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));
             }