From 8ae95baabf8734a7c0a1099f31d7af9442227f32 Mon Sep 17 00:00:00 2001 From: Vlad Shashkov Date: Tue, 4 Jul 2023 17:44:15 +0700 Subject: [PATCH 1/2] Remove attribute polyfill --- src/polyfill.php | 76 +----------------------------------------------- 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/src/polyfill.php b/src/polyfill.php index 480310d4..902265ba 100644 --- a/src/polyfill.php +++ b/src/polyfill.php @@ -41,78 +41,4 @@ class NamedArgumentConstructor { } } -} - -namespace { - use JetBrains\PhpStorm\ExpectedValues; - - if (!\class_exists(Attribute::class, false)) { - #[Attribute(Attribute::TARGET_CLASS)] - final class Attribute - { - /** - * Marks that attribute declaration is allowed only in classes. - * - * @var Attribute::TARGET_* - */ - public const TARGET_CLASS = 0b00000001; - - /** - * Marks that attribute declaration is allowed only in functions. - * - * @var Attribute::TARGET_* - */ - public const TARGET_FUNCTION = 0b00000010; - - /** - * Marks that attribute declaration is allowed only in class methods. - * - * @var Attribute::TARGET_* - */ - public const TARGET_METHOD = 0b00000100; - - /** - * Marks that attribute declaration is allowed only in class properties. - * - * @var Attribute::TARGET_* - */ - public const TARGET_PROPERTY = 0b00001000; - - /** - * Marks that attribute declaration is allowed only in class constants. - * - * @var Attribute::TARGET_* - */ - public const TARGET_CLASS_CONSTANT = 0b00010000; - - /** - * Marks that attribute declaration is allowed only in function or method parameters. - * - * @var Attribute::TARGET_* - */ - public const TARGET_PARAMETER = 0b00010000; - - /** - * Marks that attribute declaration is allowed anywhere. - * - * @var int-mask-of - */ - public const TARGET_ALL = self::TARGET_CLASS - | self::TARGET_FUNCTION - | self::TARGET_METHOD - | self::TARGET_PROPERTY - | self::TARGET_PARAMETER - ; - - /** - * Notes that an attribute declaration in the same place is allowed multiple times. - */ - public const IS_REPEATABLE = 0b00100000; - - /** - * @var int-mask-of - */ - public $flags; - } - } -} +} \ No newline at end of file From 1b907ff653bad7c1485943e50b7d1e6d8b47313e Mon Sep 17 00:00:00 2001 From: Vlad Shashkov Date: Tue, 4 Jul 2023 17:53:21 +0700 Subject: [PATCH 2/2] Fixed code-style --- src/polyfill.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyfill.php b/src/polyfill.php index 902265ba..2d216c7b 100644 --- a/src/polyfill.php +++ b/src/polyfill.php @@ -41,4 +41,4 @@ class NamedArgumentConstructor { } } -} \ No newline at end of file +}