diff --git a/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php index abd68ed6c4..f6b99a16ae 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php @@ -66,12 +66,16 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader */ public function supports($resource, $type = null) { + if (!is_string($resource)) { + return false; + } + try { $path = $this->locator->locate($resource); } catch (\Exception $e) { return false; } - return is_string($resource) && is_dir($path) && (!$type || 'annotation' === $type); + return is_dir($path) && (!$type || 'annotation' === $type); } }