-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add support for PHPStan 2.0 extensions #4328
Comments
Solution found ! By adding support to https://github.com/phpstan/extension-installer, we can now run PHPStan analysis with v1.12 or v2.0 without raising
In my own situation, the {
"require-dev": {
"phpstan/phpstan": "^1.12",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan-doctrine": "^1.5"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
} PHPStan analysis results
So, if I keep continue to run MegaLinter 8.1 (PHPStan 1.12) my project won't raised error in my CI, and will let me a chance to fix new PHPStan issue detected on next days. |
… solve issue conflict related by oxsecurity/megalinter#4328
Tip For PHP users that are in front of same issue : See llaville/php-compatinfo-db@efd2ecd |
PR to solved it is running ... |
* fix issue #4328 * [MegaLinter] Apply linters fixes * [build-command] Update generated files --------- Co-authored-by: llaville <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Is your feature request related to a problem? Please describe.
Yesterday, I've replaced my old PHPStan baseline error file by the
phpstan/phpstan-doctrine
official extension.See llaville/php-compatinfo-db@db3913d
While if works fine locally and in MegaLinter v8.1 context which have only PHPStan 1.x support, it does not work with MegaLinter v8.2 or greater that have added PHPStan 2.x support only.
PHPStan 1.x locally
Megalinter 8.3 context
Reproductible with PHPStan 2.x locally
Describe the solution you'd like
I've tried to upgrade PHPStan locally for testing purpose
And run analysis again.
Even if PHPStan 2.0 show me more errors than PHPStan 1.12, it works as expected : the
phpstan/phpstan-doctrine
official extension is well detected and used.PHPStan 2.0.2 analysis results
Describe alternatives you've considered
Add support to both PHPStan 1.x and 2.x into MegaLinter v8 to allow a smooth transition to all PHP users
Additional context
@nvuillam I've noticed old lines that we should removed too : Could you confirm this point ?
https://github.com/oxsecurity/megalinter/blob/v8.3.0/megalinter/descriptors/php.megalinter-descriptor.yml#L111-L112
The text was updated successfully, but these errors were encountered: