Skip to content

Commit

Permalink
Get rid of unnecessary Attribute pollyfill (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
root-aza committed Jul 4, 2023
1 parent b1c3f9c commit 3d3aab1
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions src/polyfill.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,77 +42,3 @@ 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<Attribute::TARGET_*>
*/
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<Attribute::TARGET_*>
*/
public $flags;
}
}
}

0 comments on commit 3d3aab1

Please sign in to comment.