-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Upgrade to PSR12 coding standard #20121
Upgrade to PSR12 coding standard #20121
Conversation
razvanphp
commented
Mar 2, 2024
•
edited
Loading
edited
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ✔️ |
Breaks BC? | ❌ |
Fixed issues | yiisoft/yii2-coding-standards#42 |
PR Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20121 +/- ##
==========================================
- Coverage 48.02% 48.01% -0.02%
==========================================
Files 445 445
Lines 43892 43909 +17
==========================================
+ Hits 21080 21083 +3
- Misses 22812 22826 +14 ☔ View full report in Codecov by Sentry. |
Funny thing is... because of |
This touches every file because of the copyright header missing space. @see PSR12 Chapter 3.
53e5b29
to
9170626
Compare
Overall it looks good except what's mentioned in comments. Let's fix it and merge. |
@razvanphp Yes, it was never finished and AFAIK never worked as part of CI. |
Generic.WhiteSpace.DisallowTabIndent.NonIndentTabsUsed
@samdark this is ready for merge FMPOV, but we need to bump the coding standard repo to use PSR12, then all the tests will pass. BTW: why is this PHP 5.4 test failing now? seem that indeed array_column function was added only in PHP 5.5, so that's why it fails in 5.4, but we did not touch that file.... |
Done. Still errors. |
but we need a major tag to bump the coding standards in |
PHP 5.4 error is very weird cause it doesn't error in master branch and function call is there. |
Tagged 3.0.0. |
It could be provided by polyfill required by php-cs-fixer. Now that php-cs-fixer is gone, all its dependencies are also unavailable. |
Good catch @rob006, fixed the test in b2585a6 Now we have to decide what we do with: The framework code initially decided to use underscore for private vars, even tho PSR2 had this rule (which is now included in PSR12 too). Should we goo all-in without underscores and adhere to PSR12 fully or add underscore for missing ones? |
AFAIK underscore in Yii is not to indicate visibility, bot to avoid conflicts with virtual attributes provided by getters and setters. So sometimes you use it, sometimes not, I don't think there is a rule smart enough to cover this. |
Underscores are to be kept. This is a technical thing, not just style. |
All checks have passed. Please see my last 2 commits. |
Merged. Thank you for working on it. |