Closed kylekatarnls closed 4 years ago
I'm not sure. Is there a reason for the type @lookyman?
Anyway, phpstan/extension-installer can afford to be opinionated. It doesn't have to be used by everyone. You can always include your extension.neon
manually in your project's phpstan.neon
.
Hi,
I'm in the same situation here. I am trying to create a phpstan extension for mapado/rest-client-sdk, and I would prefer include the phpstan files directly in the library because they are really coupled.
I think we can replace in https://github.com/phpstan/extension-installer/blob/master/src/Plugin.php#L85
- if ($package->getType() !== 'phpstan-extension') {
+ if ($package->getType() !== 'phpstan-extension' || !isset($package->getExtra()['phpstan']['includes'])) {
I am willing to make a PR if you are OK with this.
This condition is wrong, you need negated one.
This condition is wrong, you need negated one.
I updated the snippet 😉
Please use &&
instaed of ||
. I will accept the PR.
@ondrejmirtes Done
There really isn't a reason for the package type. I think I just wanted a safeguard for the installer to kick in. I'm fine with removing it.
I think it’s great for finding compatible packages on Packagist: https://packagist.org/explore/?type=phpstan-extension
But it should be optional in the definition.
Solved with #16.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello, I'm considering adding an extension.neon in an existing library to help recognizing methods available via
__call
/__callStatic
PHPStan can't recognize.The library itself is not a PHPStan extension (so I can't set type to phpstan-extension). But I would like than my library users who also use PHPStan get those methods recognized by PHPStan the easier way.
Creating an other package to handle the extension.neon + 1 small file seems overkill too.
And finally, I think having a
extra.phpstan
property is enough to recognize a library that includes PHPStan files. Why requiring this additionalphpstan-extension
flag?Thanks.