diff --git a/stubs/CoreGenericClasses.phpstub b/stubs/CoreGenericClasses.phpstub index 168572e7de7..f988fcf26c6 100644 --- a/stubs/CoreGenericClasses.phpstub +++ b/stubs/CoreGenericClasses.phpstub @@ -496,19 +496,19 @@ final class WeakMap implements ArrayAccess, Countable, IteratorAggregate, Traver } -#[Attribute] +#[Attribute(Attribute::TARGET_METHOD)] final class ReturnTypeWillChange { public function __construct() {} } -#[Attribute] +#[Attribute(Attribute::TARGET_PARAMETER)] final class SensitiveParameter { public function __construct() {} } -#[Attribute] +#[Attribute(Attribute::TARGET_CLASS)] final class AllowDynamicProperties { public function __construct() {} diff --git a/tests/AttributeTest.php b/tests/AttributeTest.php index b77b9d6aa67..76d511fe853 100644 --- a/tests/AttributeTest.php +++ b/tests/AttributeTest.php @@ -787,6 +787,22 @@ public function anotherMethod(): string false, '8.1', ], + 'sensitiveParameterOnMethod' => [ + ' 'Attribute SensitiveParameter cannot be used on a method', + ], ]; } }