浏览代码

[DependencyInjection] fixed interface injection when the class is not available

Fabien Potencier 14 年之前
父节点
当前提交
183acd8460
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Symfony/Component/DependencyInjection/InterfaceInjector.php

+ 4 - 0
src/Symfony/Component/DependencyInjection/InterfaceInjector.php

@@ -90,6 +90,10 @@ class InterfaceInjector
     public function supports($object)
     {
         if (is_string($object)) {
+            if (!class_exists($object)) {
+                return false;
+            }
+
             $reflection = new \ReflectionClass($object);
 
             return $reflection->isSubClassOf($this->class)