Skip to content

Report use of deprecated phpdoc annotations #240

Open

Description

@staabm

PHPUnit 12.x removed support for annotations, therefore we can prevent unneccessary phpdoc parsing, when PHPUnit 12+ is detected

see https://phpunit.de/announcements/phpunit-11.html

Metadata

PHPUnit 10 introduced support for PHP 8 attributes to add metadata to test classes and test methods. Previously, annotations in special PHP comments called "docblocks" or "doc-comments" were the only way to add metadata to units of code.

In PHPUnit 11, the annotations that can be used in special PHP comments to add metadata to test classes and test methods are deprecated. Support for these annotations will be removed in PHPUnit 12.

see also discussion at #239 (review)

Activity

  1. changed the title [-]Don't parse PHPDocs for PHPUnit[/-] [+]Don't parse PHPDocs for PHPUnit 12+[/+] on Oct 14, 2025
  2. staabm commented on Oct 27, 2025

    @staabm
    ContributorAuthor

    @staabm I don't think we should use this knowledge to improve performance (it'd be negligible). I think we should use it to report "@dataProvider is deprecated on PHPUnit 11.x" (when %deprecationRulesInstalled% is true) and on PHPUnit 12.x to report that it's no longer supported 😊

    from #239 (comment)

  3. changed the title [-]Don't parse PHPDocs for PHPUnit 12+[/-] [+]Report use of deprecated phpdoc annotations[/+] on Oct 27, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions