Merge branch '4.3' into 4.4
* 4.3: Fix displaying anonymous classes on PHP >= 7.4.2
This commit is contained in:
commit
ef8b34c75f
@ -873,7 +873,7 @@ class Application implements ResetInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false !== strpos($message, "class@anonymous\0")) {
|
if (false !== strpos($message, "class@anonymous\0")) {
|
||||||
$message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) {
|
$message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||||
}, $message);
|
}, $message);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ class FlattenException
|
|||||||
public function setMessage($message)
|
public function setMessage($message)
|
||||||
{
|
{
|
||||||
if (false !== strpos($message, "class@anonymous\0")) {
|
if (false !== strpos($message, "class@anonymous\0")) {
|
||||||
$message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) {
|
$message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||||
}, $message);
|
}, $message);
|
||||||
}
|
}
|
||||||
|
@ -761,7 +761,7 @@ class ErrorHandler
|
|||||||
*/
|
*/
|
||||||
private function parseAnonymousClass(string $message): string
|
private function parseAnonymousClass(string $message): string
|
||||||
{
|
{
|
||||||
return preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', static function ($m) {
|
return preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', static function ($m) {
|
||||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||||
}, $message);
|
}, $message);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ class FlattenException extends LegacyFlattenException
|
|||||||
public function setMessage($message): self
|
public function setMessage($message): self
|
||||||
{
|
{
|
||||||
if (false !== strpos($message, "class@anonymous\0")) {
|
if (false !== strpos($message, "class@anonymous\0")) {
|
||||||
$message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) {
|
$message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||||
}, $message);
|
}, $message);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class ClassStub extends ConstStub
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false !== strpos($identifier, "class@anonymous\0")) {
|
if (false !== strpos($identifier, "class@anonymous\0")) {
|
||||||
$this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) {
|
$this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||||
}, $identifier);
|
}, $identifier);
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ class ExceptionCaster
|
|||||||
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
|
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
|
||||||
|
|
||||||
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "class@anonymous\0")) {
|
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "class@anonymous\0")) {
|
||||||
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) {
|
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||||
}, $a[Caster::PREFIX_PROTECTED.'message']);
|
}, $a[Caster::PREFIX_PROTECTED.'message']);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user