Visitar URL original
Update Error Docs by phpstan-bot · Pull Request #15362 · phpstan/phpstan · GitHub
Skip to content

Update Error Docs - #15362

Open
phpstan-bot wants to merge 1 commit into
phpstan:2.3.xfrom
phpstan-bot:create-pull-request/patch-4e8ky9p
Open

phpstan-bot wants to merge 1 commit into
phpstan:2.3.xfrom
phpstan-bot:create-pull-request/patch-4e8ky9p

Conversation

@phpstan-bot

Copy link
Copy Markdown
Contributor

Adds documentation for 7 error identifiers related to the new @pure-unless-parameter-passed PHPDoc tag that had no .md files in website/errors/:

  • method.impureOverridePureUnlessParameterPassed: an impure method overrides a parent method marked @pure-unless-parameter-passed. Introduced in phpstan-src b0e7a99. It is reported by MethodSignatureRule when reportMethodPurityOverride is on, which is part of Bleeding Edge.
  • pureFunction.nonOptionalParameterPassed, pureMethod.nonOptionalParameterPassed, purePropertyHook.nonOptionalParameterPassed: the tagged parameter is required, so the function can never be pure.
  • pureFunction.parameterPassedNotByRef, pureMethod.parameterPassedNotByRef, purePropertyHook.parameterPassedNotByRef: the tagged parameter is passed by value, so the tag has no meaning.

The error messages and examples come from FunctionPurityCheck, MethodSignatureRule, and their test fixtures in phpstan-src 2.3.x (pure-unless-parameter-passed.php, pure-unless-parameter-passed-method.php, method-signature-pure-unless-parameter-passed.php). PHP does not allow defaults or by-reference parameters on property hook parameters, so the two property hook pages explain that they exist for consistency with the function and method variants.

The rest of the commit diff only moved line numbers in existing MethodSignatureRule URLs (method.childParameterType, method.childReturnType). Those docs did not need changes.

🤖 Generated with Claude Code

- Add method.impureOverridePureUnlessParameterPassed
- Add pureFunction/pureMethod/purePropertyHook.nonOptionalParameterPassed
- Add pureFunction/pureMethod/purePropertyHook.parameterPassedNotByRef
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