mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
AllowDynamicProperties: use fully qualified name in validation errors (#19296)
This commit is contained in:
@@ -8,4 +8,4 @@ enum Test {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to enum Test in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to enum Test in %s on line %d
|
||||
|
||||
@@ -8,4 +8,4 @@ interface Test {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to interface Test in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to interface Test in %s on line %d
|
||||
|
||||
@@ -8,4 +8,4 @@ trait Test {}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to trait Test in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to trait Test in %s on line %d
|
||||
|
||||
@@ -12,4 +12,4 @@ $readonly_anon = new #[AllowDynamicProperties] readonly class {
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class class@anonymous in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to readonly class class@anonymous in %s on line %d
|
||||
|
||||
@@ -10,4 +10,4 @@ readonly class Foo
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class Foo in %s on line %d
|
||||
Fatal error: Cannot apply #[\AllowDynamicProperties] to readonly class Foo in %s on line %d
|
||||
|
||||
@@ -73,22 +73,22 @@ static void validate_allow_dynamic_properties(
|
||||
zend_attribute *attr, uint32_t target, zend_class_entry *scope)
|
||||
{
|
||||
if (scope->ce_flags & ZEND_ACC_TRAIT) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[AllowDynamicProperties] to trait %s",
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[\\AllowDynamicProperties] to trait %s",
|
||||
ZSTR_VAL(scope->name)
|
||||
);
|
||||
}
|
||||
if (scope->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[AllowDynamicProperties] to interface %s",
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[\\AllowDynamicProperties] to interface %s",
|
||||
ZSTR_VAL(scope->name)
|
||||
);
|
||||
}
|
||||
if (scope->ce_flags & ZEND_ACC_READONLY_CLASS) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[AllowDynamicProperties] to readonly class %s",
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[\\AllowDynamicProperties] to readonly class %s",
|
||||
ZSTR_VAL(scope->name)
|
||||
);
|
||||
}
|
||||
if (scope->ce_flags & ZEND_ACC_ENUM) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[AllowDynamicProperties] to enum %s",
|
||||
zend_error_noreturn(E_ERROR, "Cannot apply #[\\AllowDynamicProperties] to enum %s",
|
||||
ZSTR_VAL(scope->name)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user