From 5e805850ccb377107b3f14929ce121b9774c5438 Mon Sep 17 00:00:00 2001 From: Tischoi Date: Wed, 25 Jun 2014 22:19:01 +0200 Subject: [PATCH] Update AnnotationDirectoryLoader.php --- .../Component/Routing/Loader/AnnotationDirectoryLoader.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } }