From 3c2018a1e0b1dfa37b880ef109427574b3485bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 24 Aug 2022 21:31:02 +0200 Subject: [PATCH] Configure a correct attribute target in stubs/CoreGenericClasses.phpstub --- stubs/CoreGenericClasses.phpstub | 6 +++--- tests/AttributeTest.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) 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', + ], ]; } }