Add PHPStan\dumpPhpDocType()#3559
Conversation
9481317 to
cc9e271
Compare
There was a problem hiding this comment.
Use the Printer here (https://phpstan.github.io/phpdoc-parser/2.0.x/PHPStan.PhpDocParser.Printer.Printer.html#_print), not Node::__toString(). It's more precise, uses less parentheses, only where needed.
There was a problem hiding this comment.
Can you also try some of the special multi-byte characters you did in the previous PR? (\x??)
src/dumpType.php
Outdated
There was a problem hiding this comment.
I know this is copied from dumpType, but I always wondered: Why does this even return something?
PHPStorm always complains that the result is not used.
Can't we make this return void? Then do the same for the other helpers?
/cc @ondrejmirtes
There was a problem hiding this comment.
We can’t make void functions pure, that’s why.
Personally I turn this off in PhpStorm, as PHPStan will tell me the same thing.
There was a problem hiding this comment.
I think this is because if declared as void, dumpType() would affect the purity of the embedded function.
|
This pull request has been marked as ready for review. |
c330ef5 to
9985e47
Compare
|
Thank you! |
|
@zonuexe please see PHP7.4 only test errors https://github.com/phpstan/phpstan-src/actions/runs/11254262628/job/31291308442?pr=3561 interesstingly these appear in a followup PR, and were not detected in this PR here. maybe its a PHPStan 2.x only thing |

resolve phpstan/phpstan#11823, refs #3555