From 44e598985006cb1c13b1d5f7778aeaae7ba795a2 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 4 Feb 2017 09:30:23 +0100 Subject: [PATCH] [Cache] Fix class exists checks in PhpArrayAdapter --- src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php b/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php index e4d8ad5eea318..c272ad0a4ae5f 100644 --- a/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php @@ -373,15 +373,15 @@ private function generateItems(array $keys) */ public static function throwOnRequiredClass($class) { - $e = new \ReflectionException(sprintf('Class %s does not exist', $class)); + $e = new \ReflectionException("Class $class does not exist"); $trace = $e->getTrace(); $autoloadFrame = array( 'function' => 'spl_autoload_call', 'args' => array($class), ); - $i = array_search($autoloadFrame, $trace); + $i = 1 + array_search($autoloadFrame, $trace, true); - if (false !== $i++ && isset($trace[$i]['function']) && !isset($trace[$i]['class'])) { + if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) { switch ($trace[$i]['function']) { case 'get_class_methods': case 'get_class_vars':