Skip to content

Commit 081f7b4

Browse files
bug #21528 [Cache] Fix class exists checks in PhpArrayAdapter (nicolas-grekas)
This PR was merged into the 3.2 branch. Discussion ---------- [Cache] Fix class exists checks in PhpArrayAdapter | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Fixes HHVM, as spotted in #21527 Commits ------- 44e5989 [Cache] Fix class exists checks in PhpArrayAdapter
2 parents d5a9532 + 44e5989 commit 081f7b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,15 @@ private function generateItems(array $keys)
373373
*/
374374
public static function throwOnRequiredClass($class)
375375
{
376-
$e = new \ReflectionException(sprintf('Class %s does not exist', $class));
376+
$e = new \ReflectionException("Class $class does not exist");
377377
$trace = $e->getTrace();
378378
$autoloadFrame = array(
379379
'function' => 'spl_autoload_call',
380380
'args' => array($class),
381381
);
382-
$i = array_search($autoloadFrame, $trace);
382+
$i = 1 + array_search($autoloadFrame, $trace, true);
383383

384-
if (false !== $i++ && isset($trace[$i]['function']) && !isset($trace[$i]['class'])) {
384+
if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) {
385385
switch ($trace[$i]['function']) {
386386
case 'get_class_methods':
387387
case 'get_class_vars':

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy