Skip to content

Commit f66bed7

Browse files
committed
feature #10506 [Debug] sync with deprecation in DebugClassLoader (nicolas-grekas)
This PR was merged into the 2.5-dev branch. Discussion ---------- [Debug] sync with deprecation in DebugClassLoader | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none Commits ------- c70a468 [Debug] sync with deprecation in DebugClassLoader
2 parents ad88cdd + c70a468 commit f66bed7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,17 @@ private function getClassCandidates($class)
103103
}
104104

105105
// get class loaders wrapped by DebugClassLoader
106-
if ($function[0] instanceof DebugClassLoader && method_exists($function[0], 'getClassLoader')) {
107-
$function[0] = $function[0]->getClassLoader();
106+
if ($function[0] instanceof DebugClassLoader) {
107+
$function = $function[0]->getClassLoader();
108+
109+
// Since 2.5, returning an object from DebugClassLoader::getClassLoader() is @deprecated
110+
if (is_object($function)) {
111+
$function = array($function);
112+
}
113+
114+
if (!is_array($function)) {
115+
continue;
116+
}
108117
}
109118

110119
if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) {

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