Merge branch '3.4' into 4.4
* 3.4: Fix PHP 8 deprecations ensure compatibility with PHP 8 stack traces
This commit is contained in:
commit
07c11399ae
@ -305,10 +305,17 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
'function' => 'spl_autoload_call',
|
||||
'args' => [$class],
|
||||
];
|
||||
$i = 1 + array_search($autoloadFrame, $trace, true);
|
||||
|
||||
if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) {
|
||||
switch ($trace[$i]['function']) {
|
||||
if (\PHP_VERSION_ID >= 80000 && isset($trace[1])) {
|
||||
$callerFrame = $trace[1];
|
||||
} elseif (false !== $i = array_search($autoloadFrame, $trace, true)) {
|
||||
$callerFrame = $trace[++$i];
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if (isset($callerFrame['function']) && !isset($callerFrame['class'])) {
|
||||
switch ($callerFrame['function']) {
|
||||
case 'get_class_methods':
|
||||
case 'get_class_vars':
|
||||
case 'get_parent_class':
|
||||
|
@ -190,12 +190,17 @@ class ClassExistenceResource implements SelfCheckingResourceInterface
|
||||
'args' => [$class],
|
||||
];
|
||||
|
||||
if (false === $i = array_search($autoloadFrame, $trace, true)) {
|
||||
if (\PHP_VERSION_ID >= 80000 && isset($trace[1])) {
|
||||
$callerFrame = $trace[1];
|
||||
$i = 2;
|
||||
} elseif (false !== $i = array_search($autoloadFrame, $trace, true)) {
|
||||
$callerFrame = $trace[++$i];
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if (isset($trace[++$i]['function']) && !isset($trace[$i]['class'])) {
|
||||
switch ($trace[$i]['function']) {
|
||||
if (isset($callerFrame['function']) && !isset($callerFrame['class'])) {
|
||||
switch ($callerFrame['function']) {
|
||||
case 'get_class_methods':
|
||||
case 'get_class_vars':
|
||||
case 'get_parent_class':
|
||||
@ -214,8 +219,8 @@ class ClassExistenceResource implements SelfCheckingResourceInterface
|
||||
}
|
||||
|
||||
$props = [
|
||||
'file' => isset($trace[$i]['file']) ? $trace[$i]['file'] : null,
|
||||
'line' => isset($trace[$i]['line']) ? $trace[$i]['line'] : null,
|
||||
'file' => isset($callerFrame['file']) ? $callerFrame['file'] : null,
|
||||
'line' => isset($callerFrame['line']) ? $callerFrame['line'] : null,
|
||||
'trace' => \array_slice($trace, 1 + $i),
|
||||
];
|
||||
|
||||
|
Reference in New Issue
Block a user