Skip to content

Run the tests written for @pure-unless-parameter-passed - #310

Merged
ondrejmirtes merged 1 commit into
2.3.xfrom
fix-pure-unless-parameter-passed
Aug 30, 2026
Merged

Run the tests written for @pure-unless-parameter-passed#310
ondrejmirtes merged 1 commit into
2.3.xfrom
fix-pure-unless-parameter-passed

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

providePureUnlessParameterIsPassedTagsData was written for @pure-unless-parameter-passed in fb19eed, but was never named among the @dataProvider lines testParse is run with. Its two cases had never run.

They do not pass. PureUnlessParameterIsPassedTagValueNode is the one concrete node of src/Ast/PhpDoc without a __set_state(), and testParse writes every node out with var_export() and reads it back:

Error: Call to undefined method PHPStan\PhpDocParser\Ast\PhpDoc\PureUnlessParameterIsPassedTagValueNode::__set_state()

So this names the provider and gives the node the __set_state() its siblings have — PureUnlessCallableIsImpureTagValueNode's, word for word.

Found while writing the grammar-sync test of #309, which reads the inputs of every other test out of the providers they are written with, and so walks over providers nothing else runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GavWEzia8ZVUYEe6JEde9i

The provider holding them was written but never named among the ones
`testParse` is run with, so its two cases had never run. They do not pass:
`PureUnlessParameterIsPassedTagValueNode` is the one node of
`src/Ast/PhpDoc` without a `__set_state()`, which is what the test reads
the node back with after writing it out with `var_export()`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GavWEzia8ZVUYEe6JEde9i
@ondrejmirtes
ondrejmirtes merged commit e4b19f0 into 2.3.x Aug 30, 2026
59 checks passed
@ondrejmirtes
ondrejmirtes deleted the fix-pure-unless-parameter-passed branch August 30, 2026 16:19
@staabm

staabm commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Nice catch. Thank you.

I guess PHPStan would have caught it as a unused method in case shipmonk/dead-code-detector would be included in this package?

@ondrejmirtes

Copy link
Copy Markdown
Member Author

Yes, it should catch that

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