From f1f1494bbf4c742e27e86fb7b4154f8377cf8b3d Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 2 Apr 2012 19:53:22 +0200 Subject: [PATCH] Added an exception when passing an invalid object to ApcClassLoader --- src/Symfony/Component/ClassLoader/ApcClassLoader.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/ClassLoader/ApcClassLoader.php b/src/Symfony/Component/ClassLoader/ApcClassLoader.php index 523e9a87e5..bf70bfc958 100644 --- a/src/Symfony/Component/ClassLoader/ApcClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ApcClassLoader.php @@ -58,6 +58,10 @@ class ApcClassLoader throw new \RuntimeException('Unable to use ApcUniversalClassLoader as APC is not enabled.'); } + if (!method_exists($classFinder, 'findFile')) { + throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); + } + $this->prefix = $prefix; $this->classFinder = $classFinder; }