Преглед на файлове

[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)