8000 Prevent error when the autoload function is an instance of DebugClass… · symfony/symfony@d698d23 · GitHub
[go: up one dir, main page]

Skip to content

Commit d698d23

Browse files
committed
Prevent error when the autoload function is an instance of DebugClassloader, but does not wrap a closure
1 parent 20bf17f commit d698d23

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Symfony/Component/ErrorHandler/Tests/ErrorEnhancer/ClassNotFoundErrorEnhancerTest.php

Lines changed: 6 additions & 4 deletions
< 8000 /div>
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ public static function setUpBeforeClass(): void
2727
continue;
2828
}
2929

30+
$function = $function[0];
31+
3032
// get class loaders wrapped by DebugClassLoader
31-
if ($function[0] instanceof DebugClassLoader) {
32-
$function = $function[0]->getClassLoader();
33+
if ($function instanceof DebugClassLoader) {
34+
$function = $function->getClassLoader();
3335
}
3436

35-
if ($function[0] instanceof ComposerClassLoader) {
36-
$function[0]->add('Symfony_Component_ErrorHandler_Tests_Fixtures', \dirname(__DIR__, 5));
37+
if ($function instanceof ComposerClassLoader) {
38+
$function->add('Symfony_Component_ErrorHandler_Tests_Fixtures', \dirname(__DIR__, 5));
3739
break;
3840
}
3941
}

0 commit comments

Comments
 (0)
0