extension-installer
extension-installer copied to clipboard
Install phpstan extension also for root package
fixes https://github.com/phpstan/extension-installer/issues/36
PR is done, Build / PHPStan (8.0, highest)
CI error seems unrelated
@ondrejmirtes can you please review this PR?
- This PR does too many unrelated changes
- I'm not even sure that https://github.com/phpstan/extension-installer/issues/36 is a real problem that needs solving. The whole point of this package is that it saves a few lines in your phpstan.neon.
- This PR does too many unrelated changes
I have separated the verbose logging to https://github.com/phpstan/extension-installer/pull/42, all other changes are related
- I'm not even sure that composer.json's
extra
section must be honored also for root-package #36 is a real problem that needs solving. The whole point of this package is that it saves a few lines in your phpstan.neon.
Exactly that is the point. When phpstan config is added to composer.json, it must always apply.
Currently, for the root project, all configs must be included on two locations - like in https://github.com/atk4/data/blob/b0b50a0f0ae5ce280a180beb0dfd63f08100e02f/phpstan.neon.dist#L1-L3 . And if such config is then run from another project, it will even fail as included twice, steps to reproduce:
- create some repo with this ext, require package x/y with phpstan config
phpstan-ext.neon
specified in composer.json and also include that config inphpstan.neon
- run composer install
- run phpstan from the "some repo" on vendor/x/y
- currently, phpstan will fail as
phpstan-ext.neon
is loaded twice - with this PR,
phpstan-ext.neon
is enough to be specified in a single place - composer.json, phpstan always finish no matter if run from x/y project directly or from root project
@ondrejmirtes can you please review?
I'm still not sure about the implications and the usefulness. I'd rather not do it.
yes, repos including some extra conf manually need to be updated (otherwise phpstan will throw for config included twice), but this PR unifies how the composer config behaves - like for ex. autoload
config - it works for root project and also when included
other than this change needed, do you have any other implication in head?
to maintain compatibility with existing projects, what about releasing this as 2.x version?
I feel like there isn't any demand for this, and I feel against it too. So closing. Thanks for understanding.