-
Notifications
You must be signed in to change notification settings - Fork 40
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
The great coding standards restoration #6004
Comments
One down, a zillion to go! |
Just started to look at |
I found this page but I am still not able to decipher what is needed, |
This is solved by adding a visibility qualifier in the method declaration such as public, protected or private. |
So since all these 9 problems are contained within |
I have found some more specific details here, https://www.php.net/manual/en/language.oop5.visibility.php |
This link provides more details, https://stackoverflow.com/a/4361582
Thus, since nothing was used before it is probably safe to add |
I guess this is a time that now a visibility qualifier is being added the code can be "improved" by selecting some thing other than "public" where it might be appropriate. I don't have the depth of knowledge to make that determination. |
If the function was previously implicitly Some functions might warrant a change in visibility to |
Maybe, the place to raise that would be once there is a pull request. Although there may be a number of instances. |
I also noticed there are other qualifiers like |
Should I start a PR with what I have done so far even though it is incomplete? So others don't jump into doing the same one? |
I took a stab at cleaning up the See PR at backdrop/backdrop#4915 |
Although it looked like a huge task, backdrop/backdrop#4915 seems to move fast. Some more "but this can also be null" comments 😉, but I'm done now with review. (And phpcs found some indentation issues.) |
Tentatively marking backdrop/backdrop#4915 as RTBC - phpcs checks pass. There are still some open comments re method removal/addition, but consensus seems to be, that these changes are harmless. @quicksketch many thanks for sacrificing your weekend to improve the database abstraction layer documentation. 👍 |
Thank you @indigoxela! I think the changes are low-risk. I merged into 1.x and cherry-picked into 1.29.x, so backdrop/backdrop#4915 changes will be in 1.29.3 |
One of the most frequent PHPCS issues we get is scoping on SimpleTest methods, and that frequently confuses contributors who don't know whether tests should be public/protected/private. I tackled specifically that issue with a find/replace, updating 1883 methods (gulp) that did not have scoping on them. PR ready for review at backdrop/backdrop#4962. EDIT: Second PR that uses |
I'm confused by the two PR's. They do not look like they can be combined. Is one preferred over the other? |
They're total alternatives to each other, only one could be used. I think backdrop/backdrop#4963 might be the more technically correct solution, but it might not be backwards-compatible. We need to do some testing to see if it would break any other tests (such as those in contrib). If that's the case, then we'd need to go with backdrop/backdrop#4962, since an unspecified method like |
Now that we run
phpcs
against all core PRs, we should fix all existing coding issues in core to avoid getting so many warnings/errors. This issue (inspired by #3213) will list all files/modules/etc. in core and will have PRs against groups of them to make reviewing easier.By directory
core/includes/a*
: Issue #6004: Fix coding standards. backdrop#4369core/includes/b*
: Issue #6004: Fix coding standards. backdrop#4370core/includes/c*
core/includes/database/*
: Issue #6004: Coding standards cleanup for database system. backdrop#4915core/includes/d*
core/includes/e*
core/includes/f*
core/includes/[g-i]*
core/includes/[l-m]*
core/includes/p*
core/includes/[s-t]*
core/includes/transliteration*
core/includes/u*
core/modules/admin_bar
core/modules/block
core/modules/book
core/modules/ckeditor
core/modules/color
core/modules/comment
core/modules/comment/views
core/modules/config
core/modules/contact
core/modules/contextual
core/modules/dashboard
core/modules/date
core/modules/date/views
core/modules/[dblog,email]
core/modules/entity
core/modules/entityreference
core/modules/field_ui
core/modules/field
core/modules/field/modules
core/modules/field/[tests,views]
core/modules/file
core/modules/file/views
core/modules/filter
core/modules/image
core/modules/installer
core/modules/language
core/modules/layout
core/modules/layout/includes
core/modules/layout/plugins
core/modules/layout/[templates,tests]
core/modules/link
core/modules/locale
core/modules/local/views
core/modules/menu
core/modules/node
core/modules/node/views
core/modules/path
core/modules/redirect
core/modules/search
core/modules/search/[templates,tests,views]
core/modules/simpletest
core/modules/simpletest/tests/[a-b]*
core/modules/simpletest/tests/c*
core/modules/simpletest/tests/d*
core/modules/simpletest/tests/[e-f]*
core/modules/simpletest/tests/[g-m]*
core/modules/simpletest/tests/[n-s]*
core/modules/simpletest/tests/t*
core/modules/simpletest/tests/u*
core/modules/syslog
core/modules/system
core/modules/system.system.[a-m]*
core/modules/system.system.[n-z]*
core/modules/taxonomy
core/modules/taxonomy/views
core/modules/telemetry
core/modules/translation
core/modules/update
core/modules/user
core/modules/user/tests
core/modules/user/views
core/modules/views_ui
core/modules/views
core/modules/views/handlers/views_handler_a*
core/modules/views/handlers/views_handler_field*
core/modules/views/handlers/views_handler_filter*
core/modules/views/handlers/views_handler_[r-s]*
core/modules/views/includes
core/modules/views/plugins/views_plugin_a*
core/modules/views/plugins/views_plugin_[c-d]*
core/modules/views/plugins/views_plugin_[e-q]*
core/modules/views/plugins/views_plugin_[r-s]*
core/modules/views/templates
core/modules/views/tests
core/modules/views/tests/[handlers,plugins,styles]
core/profiles
core/themes
[misc.]
By topic
Anyone wanting to make a PR should:
phpcs
installed and Backdrop's Coding Standards repo one directory above Backdrop core (I personally use Lando)phpcs
from Backdrop's root directory like so:phpcs --basepath=. --standard=../phpcs/Backdrop core/includes/a*
(change the last bit to match whatever group of files you're targeting)For https://github.com/backdrop/backdrop-issues/issues/6004
(avoiding any keywords that automatically link the PR to this issue and therefore result in closing this issue when the PR is merged)The text was updated successfully, but these errors were encountered: