[VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
This commit is contained in:
parent
63eab44e69
commit
ab45e2aaae
@ -92,10 +92,24 @@ class SplCaster
|
||||
unset($a["\0SplFileInfo\0fileName"]);
|
||||
unset($a["\0SplFileInfo\0pathName"]);
|
||||
|
||||
if (false === $c->getPathname()) {
|
||||
$a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
|
||||
if (\PHP_VERSION_ID < 80000) {
|
||||
if (false === $c->getPathname()) {
|
||||
$a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
|
||||
|
||||
return $a;
|
||||
return $a;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
$c->isReadable();
|
||||
} catch (\RuntimeException $e) {
|
||||
if ('Object not initialized' !== $e->getMessage()) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($map as $key => $accessor) {
|
||||
|
Reference in New Issue
Block a user