Psalm tries to read @phpstan tags that it does not support
I have a phpdoc like this: @phpstan-param ReadonlyMessageContext<*, *> $parent. I specifically wrote it for PHPStan. Now Psalm complains that this is an InvalidDocblock. Same for call-site variance. I thought that the idea behind namespaced tags is that other tools ignore them...
Hey @vudaltsov, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.
Both PHPStan and Psalm read each other's phpdoc tags, but each prefers its own. Add a @psalm-param with a syntax Psalm understand, and it will ignore @phpstan-param
Both PHPStan and Psalm read each other's phpdoc tags, but each prefers its own.
Ok, thank you! Got the idea.
Add a
@psalm-paramwith a syntax Psalm understand, and it will ignore@phpstan-param
It doesn't ignore :( https://psalm.dev/r/afa9872862
I found these snippets:
https://psalm.dev/r/afa9872862
<?php
/**
* @template T
*/
final class A {}
/**
* @psalm-param A $a
* @phpstan-param A<*> $a
*/
function a(A $a): void {}
Psalm output (using commit 1288d7a):
ERROR: InvalidDocblock - 10:19 - Invalid type '*' in docblock for a
Probably the problem here is that Psalm does not understand this phpdoc at a parsing level.
Yeah, it looks that way. Type syntax used to be mostly compatible, but that seems to be no longer the case.