Skip to content

Add allowed targets to Attributes #5518

Description

@attrib

Affected page

https://www.php.net/manual/en/class.deprecated.php

Current issue

Its missing a information where this attribute can be used:

e.g. for Deprecated

PHP 8.4:

  • Method
  • Function
  • Class Constant
  • Constant

PHP 8.5:

Adds Traits (https://wiki.php.net/rfc/deprecated_traits) (but not Class!)

Similar issue for all other attributes:

Suggested improvement

At least add the information from the stub, e.g. #[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_FUNCTION|Attribute::TARGET_CLASS_CONSTANT|Attribute::TARGET_CONSTANT|Attribute::TARGET_CLASS)] to Class synopsis.

Not sure how to handle special cases like only traits in PHP 8.5 for Deprecated Attribute

Additional context (optional)

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions