-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why type: phpstan-extension is mandatory? #13
Comments
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 |
Hi, I'm in the same situation here. 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. |
I updated the snippet 😉 |
Please use |
@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.
The text was updated successfully, but these errors were encountered: