Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 5, 2025

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 staabm marked this pull request as ready for review December 5, 2025 07:30

class DeprecatedVersionFormat extends TestCase
{
#[RequiresPhp('8.0')]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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)

@ondrejmirtes
Copy link
Member

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

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

Thank you!

@staabm staabm deleted the req branch December 5, 2025 08:05
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