-
Notifications
You must be signed in to change notification settings - Fork 1
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
Test enhancement for fix PSR-4 autoloading #1
base: master
Are you sure you want to change the base?
Test enhancement for fix PSR-4 autoloading #1
Conversation
@@ -16,7 +16,7 @@ script: | |||
# Fail the Travis CI build on the first error. | |||
- set -e | |||
- mkdir -p build/logs | |||
- php vendor/bin/phpcs --standard=PSR12 src | |||
- php vendor/bin/phpcs --standard=PSR2 src |
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.
Revert the PSR-2
coding style and it can avoid PSR-12
coding style checking to cause the Travis CI build failed.
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.
There are many things about PSR-12 that I like, in fact most things. In fact, the only thing I disagree with is that they no longer allow <?php declare(strict_types=1);
, which I strongly feel is the bestest way to declare this.
Here is the corporate workaround:
PHPExpertsInc/SimpleDTO@1faa8a4
I'm pretty sure all of our projects modded after April 8th 2020 are failing this test.
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.
Is it possible to consider using phpcs.xml
file to ignore declare(strict_types=1);
checking?
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.
@hopeseekr, after searching some solutions about ignoring declare strict type
checking, here is the proper solution:
The phpcs.xml
file is as follows:
<?xml version="1.0"?>
<ruleset name="Custom Standard" namespace="MyProject\CS\Standard">
<rule ref="PSR12">
<exclude name="PSR12.Files.FileHeader" />
<exclude name="PSR12.Files.OpenTag" />
</rule>
</ruleset>
08500bf
to
3954b9a
Compare
3954b9a
to
4819574
Compare
checkMissingIterableValueType: false | ||
paths: | ||
- src/ | ||
- tests/ |
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.
To fix following error during PHPStan
static code analyzing, using this phpstan.neon
file to ignore checkMissingIterableValueType
setting.
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.
@@ -4,6 +4,7 @@ php: | |||
- '7.1' | |||
- '7.2' | |||
- '7.3' | |||
- '7.4' |
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.
Add php-7.4
version test during Travis CI build.
Thank you very much for this PR. I am merging it next time I see it if I don't fix the issues myself. Thank you for encouraging me. |
Changed log
classmap-authoritative
to avoid deprecatedPSR-4
autoloading warning message.This change is