Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update Error Docs#14845

Open
phpstan-bot wants to merge 1 commit into
phpstan:2.2.xphpstan/phpstan:2.2.xfrom
phpstan-bot:create-pull-request/patch-yl1hd7tphpstan-bot/phpstan:create-pull-request/patch-yl1hd7tCopy head branch name to clipboard
Open

Update Error Docs#14845
phpstan-bot wants to merge 1 commit into
phpstan:2.2.xphpstan/phpstan:2.2.xfrom
phpstan-bot:create-pull-request/patch-yl1hd7tphpstan-bot/phpstan:create-pull-request/patch-yl1hd7tCopy head branch name to clipboard

Conversation

@phpstan-bot

Copy link
Copy Markdown
Contributor

The latest website/src/errorsIdentifiers.json update changed the source code locations for the phpunit.attributeRequiresPhpVersion identifier from two lines to four, reflecting that the AttributeRequiresPhpVersionRule in phpstan-phpunit was expanded.

I cloned phpstan-phpunit (branch 2.0.x) and read the updated rule and its test fixtures. The rule now reports four distinct error messages, all under the same identifier:

  • Version requirement is missing operator. — a bare numeric version (e.g. '8.1') on PHPUnit 13+.
  • Version requirement without operator is deprecated. — a bare numeric version on PHPUnit 12.4+ when phpstan-deprecation-rules is installed.
  • Version requirement will always evaluate to false. — a constraint that can never match the analysed PHP version (phpVersion).
  • Unsupported version constraint (e.g. Version constraint abc is not supported.) — an unparseable constraint string.

The existing doc only covered the missing-operator case. I rewrote website/errors/phpunit.attributeRequiresPhpVersion.md to document all four cases with code examples and fixes, updated the shortDescription, and linked the phpVersion config reference and the phpstan-deprecation-rules package where relevant.

No new identifiers were introduced and all 1097 identifiers remain documented.

- Rule in phpstan-phpunit now reports four distinct messages under
  this identifier (source locations changed from 2 to 4)
- Documented "missing operator", "without operator is deprecated",
  "will always evaluate to false", and unsupported-constraint cases
- Added fixes for each, linking phpVersion config and
  phpstan-deprecation-rules
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.