-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Switch from PHPStan to Psalm #63
Changes from all commits
373fddd
fb44204
f492f17
af38c2f
4c63fbc
bf140de
65b71ed
6cfb6d1
229030c
ce4dc51
3195759
2756602
b6de910
33bcc58
8b2ed15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"additional_composer_arguments": [ | ||
"--no-scripts", | ||
"--no-plugins" | ||
], | ||
"ignore_php_platform_requirements": { | ||
"8.1": true | ||
"8.0": false, | ||
"8.1": false | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
# Due to the fact that we are disabling plugins when installing/updating/downgrading composer dependencies | ||
# we have to manually enable the coding standard here. | ||
composer enable-codestandard |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,21 +58,19 @@ | |
"jsoumelidis/zend-sf-di-config": "^0.5", | ||
"laminas/laminas-coding-standard": "~2.3.0", | ||
"laminas/laminas-development-mode": "^3.3.0", | ||
"laminas/laminas-pimple-config": "^1.1.1", | ||
"laminas/laminas-pimple-config": "^1.4", | ||
"laminas/laminas-servicemanager": "^3.6.4", | ||
"mezzio/mezzio-fastroute": "^3.2.0", | ||
"mezzio/mezzio-laminasrouter": "^3.1.0", | ||
"mezzio/mezzio-laminasviewrenderer": "^2.3.0", | ||
"mezzio/mezzio-platesrenderer": "^2.3.0", | ||
"mezzio/mezzio-tooling": "^2.0", | ||
"mezzio/mezzio-tooling": "^2.1", | ||
"mezzio/mezzio-twigrenderer": "^2.7.0", | ||
"mikey179/vfsstream": "^1.6.8", | ||
"phpspec/prophecy": "^1.10.3", | ||
"phpspec/prophecy-phpunit": "^2.0", | ||
"phpstan/phpstan": "^0.12", | ||
"phpstan/phpstan-strict-rules": "^0.12", | ||
"phpunit/phpunit": "^9.5.5", | ||
"roave/security-advisories": "dev-master" | ||
"mikey179/vfsstream": "^1.6.10", | ||
"phpunit/phpunit": "^9.5.11", | ||
"psalm/plugin-phpunit": "^0.16.1", | ||
"roave/security-advisories": "dev-master", | ||
"vimeo/psalm": "^4.17" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
@@ -98,13 +96,18 @@ | |
"mezzio": "laminas --ansi", | ||
"check": [ | ||
"@cs-check", | ||
"@test", | ||
"@analyze" | ||
"@test" | ||
], | ||
"analyze": "phpstan analyze -l 3 -c ./phpstan.installer.neon ./src ./config", | ||
"clear-config-cache": "php bin/clear-config-cache.php", | ||
"cs-check": "phpcs -s", | ||
"cs-fix": "phpcbf", | ||
"enable-codestandard": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run", | ||
"cs-check": [ | ||
"@enable-codestandard", | ||
"phpcs -s" | ||
], | ||
"cs-fix": [ | ||
"@enable-codestandard", | ||
"phpcbf" | ||
], | ||
Comment on lines
+102
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, we could automate some of this in the laminas CI setup (to auto-push to contributor branches after message confirmation, potentially) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only necessary on projects where we are using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this is somehow solvable in another way. Yes, I know that would mean we would have to change all repositories if we wanted to roll that out for all components but IMHO its only necessary here due to the fact that we do, in fact, ignore composer plugins intentional. So instead of still relying on composer, we could simply change the path to the coding standard in the codestyle config instead. WDYT? |
||
"serve": "php -S 0.0.0.0:8080 -t public/", | ||
"test": "phpunit --colors=always", | ||
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've indicated that the
--ignore-platform-requirement
flag should NOT be used with PHP 8.0 and 8.1.composer update
operations run normally without the flag, and, when using--prefer-lowest
, we need to get requirements that are appropriate for those versions (otherwise, tests fail due to syntax errors!).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, if the property
ignore_php_platform_requirements
is available, all PHP versions will havefalse
by default.So it would be enough to simply create the property as an empty object to ensure that platform reqs won't be ignored.
If the
ignore_php_platform_requirements
property is not available, PHP 8.0 will always have ignored platform reqs.