FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement AttributeRequiresPhpVersionRule by staabm · Pull Request #268 · phpstan/phpstan-phpunit · GitHub

Implement AttributeRequiresPhpVersionRule - #268

Merged
ondrejmirtes merged 4 commits into
phpstan:2.0.xfrom
staabm:req
Dec 5, 2025
Merged

Implement AttributeRequiresPhpVersionRule#268
ondrejmirtes merged 4 commits into
phpstan:2.0.xfrom
staabm:req

Conversation

staabm commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

using #[RequiresPhp('8.3')] without a version operator like >=, ^ or similar is deprecated as of PHPUnit 12.4 and was removed in PHPUnit 13.0

refs sebastianbergmann/phpunit#6355

staabm marked this pull request as ready for review December 5, 2025 07:30

class DeprecatedVersionFormat extends TestCase
{
#[RequiresPhp('8.0')]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

in a followup I want to emit errors when the version contstraint used within #[RequiresPhp('8.0')] does not fit into the php version used for analysis (detecting tests which require php-versions no longer supported in the project)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

implemented in #269

Copy link
Copy Markdown
Member

Yeah, this is really needed, I made this mistake a few times myself.

ondrejmirtes merged commit cda423c into phpstan:2.0.x Dec 5, 2025
88 checks passed

Copy link
Copy Markdown
Member

Thank you!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL