Skip to content

Commit 51614d6

Browse files
committed
ensure compatibility with PHP 8 stack traces
1 parent 13982b5 commit 51614d6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Symfony/Component/Config/Resource/ClassExistenceResource.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,32 @@ public static function throwOnRequiredClass($class, \Exception $previous = null)
191191
];
192192

193193
if (false === $i = array_search($autoloadFrame, $trace, true)) {
194+
if (\PHP_VERSION_ID >= 80000) {
195+
foreach ($trace as $frame) {
196+
if ([$class] !== $frame['args']) {
197+
continue;
198+
}
199+
200+
switch ($frame['function']) {
201+
case 'get_class_methods':
202+
case 'get_class_vars':
203+
case 'get_parent_class':
204+
case 'is_a':
205+
case 'is_subclass_of':
206+
case 'class_exists':
207+
case 'class_implements':
208+
case 'class_parents':
209+
case 'trait_exists':
210+
case 'defined':
211+
case 'interface_exists':
212+
case 'method_exists':
213+
case 'property_exists':
214+
case 'is_callable':
215+
return;
216+
}
217+
}
218+
}
219+
194220
throw $e;
195221
}
196222

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