Attribute.php 521 B

12345678910111213141516171819202122
  1. <?php
  2. #[Attribute(Attribute::TARGET_CLASS)]
  3. final class Attribute
  4. {
  5. public const TARGET_CLASS = 1;
  6. public const TARGET_FUNCTION = 2;
  7. public const TARGET_METHOD = 4;
  8. public const TARGET_PROPERTY = 8;
  9. public const TARGET_CLASS_CONSTANT = 16;
  10. public const TARGET_PARAMETER = 32;
  11. public const TARGET_ALL = 63;
  12. public const IS_REPEATABLE = 64;
  13. /** @var int */
  14. public $flags;
  15. public function __construct(int $flags = self::TARGET_ALL)
  16. {
  17. $this->flags = $flags;
  18. }
  19. }