Skip to content

Support for @pure-unless-parameter-passed#259

Merged
ondrejmirtes merged 1 commit into
phpstan:2.0.xfrom
staabm:pure-cb-param
Jul 8, 2026
Merged

Support for @pure-unless-parameter-passed#259
ondrejmirtes merged 1 commit into
phpstan:2.0.xfrom
staabm:pure-cb-param

Conversation

@staabm

@staabm staabm commented Nov 18, 2024

Copy link
Copy Markdown
Contributor

@staabm staabm marked this pull request as ready for review November 18, 2024 15:47
@ondrejmirtes

Copy link
Copy Markdown
Member

We already have other similar implementation lined up. There's @pure-unless-callable-is-impure which is implemented in the parser (#253) but not yet in PHPStan (phpstan/phpstan-src#3482).

It's not a great look when there's a tag understood by the parser but not by the analyser. I'd like to minimize that coming into the future. It'd be nice to also have the implementation ready in phpstan-src before merging the parser countepart.

I will look at this again when phpstan/phpstan-src#3482 is merged and the implementation for @pure-unless-parameter-passed is ready in phpstan-src.

@zonuexe

zonuexe commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@ondrejmirtes phpstan/phpstan-src#6018 is ready; could you please consider merging this PR?

@ondrejmirtes ondrejmirtes merged commit ca412a0 into phpstan:2.0.x Jul 8, 2026
0 of 44 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Merged and tagged.

zonuexe added a commit to zonuexe/phpstan-src that referenced this pull request Jul 8, 2026
phpstan/phpdoc-parser#259 is merged and released, so replace the generic-tag stopgap with PhpDocNode::getPureUnlessParameterIsPassedTagValues() and bump the dependency.
zonuexe added a commit to zonuexe/phpstan-src that referenced this pull request Jul 8, 2026
Resolve the tag into per-parameter flags and merge them across parent
PHPDocs. Until phpstan/phpdoc-parser#259 is merged the parser does not
understand the tag natively, so parse it from the generic tag value and
whitelist the @phpstan- alias in InvalidPHPStanDocTagRule.
zonuexe added a commit to zonuexe/phpstan-src that referenced this pull request Jul 8, 2026
phpstan/phpdoc-parser#259 is merged and released, so replace the generic-tag stopgap with PhpDocNode::getPureUnlessParameterIsPassedTagValues() and bump the dependency.
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.

3 participants