Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of unnecessary pollyfills #11

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}
Loading