Open Ocramius opened 2 years ago
I think it should be comparable. Best way to be sure is to replace the checker by your stub and run the integration suite :)
Heh, we just introduced it, so no difference: this is mostly to understand if such a stub makes the plugin superfluous :D
Maybe one difference I see is that the checker is able to check for plain string. But I don't think that you'll care about it.
One drawback to using a stub is that PHPStorm picks it up and marks everywhere you use a ContainerInterface
with a multiple implementation warning, not only in the library hosting the stub, but also anywhere you install the library as a dependency.
Instead of .stub.php
, call it .php.stub
and you are good ;-)
Good idea! Or export-ignore it in .gitattributes
See https://github.com/laminas/laminas-inputfilter/blob/11080cf5a67fd2368d31b50e28403fb21cbf2f14/.stub.php
Copying it here for reference:
Usage:
See https://psalm.dev/r/027e9ad09e
Is this package comparable to that? What differences does it bring to that approach, and is a stub sufficient?
Ref: https://github.com/laminas/laminas-inputfilter/pull/53#discussion_r891112567