Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of meta-issue #1518116: [meta] Make Core pass Coder Review
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Reroll the patch if it no longer applies. | Novice | Instructions | |
Apply the changes from comment #13 | Novice |
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff.txt | 3.73 KB | TravisCarden |
#13 | drupal.dblog-coding-standards.1533228-13.patch | 9.98 KB | TravisCarden |
Comments
Comment #1
NROTC_Webmaster CreditAttribution: NROTC_Webmaster commentedPostponed because of #1326600: Clean up API docs for dblog module
Comment #2
theduke CreditAttribution: theduke commentedI started working on this sine the patch in #1326600 was committed.
Patch attached.
Coder reports no problems on minor.
Code Sniffer reports 3 errors:
I don't think changing this would improve readability - leave it as it is?
I am not really sure what to do about those two - writing "'" directly in the string would make it hard to read.
Adding quote as an argument would not really make sense either, since it is not dynamic.
I would just leave it the way it is.
Suggestions?
Comment #4
theduke CreditAttribution: theduke commented#2: drupal-dblog-coding-standards-1533228-2.patch queued for re-testing.
Comment #5
Lars Toomre CreditAttribution: Lars Toomre commentedWhen this gets re-rolled, we need to add a blank line after the last method and before the closing brace of the declaration of DbLogTest.php.
Comment #6
Lars Toomre CreditAttribution: Lars Toomre commented#2: drupal-dblog-coding-standards-1533228-2.patch queued for re-testing.
Comment #8
theduke CreditAttribution: theduke commentedNew patch included.
The only two remaining errors are:
FILE: ...v/drupal8.local/core/modules/dblog/lib/Drupal/dblog/Tests/DBLogTest.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
178 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
188 | ERROR | Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
--------------------------------------------------------------------------------
As stated above, I would just leave those be.
Comment #10
TravisCarden CreditAttribution: TravisCarden commentedPostponing till feature freeze. If you want to help in the meantime, please work on the blockers on the meta issue. Thanks!
Comment #11
sphism CreditAttribution: sphism commentedWe have the go ahead with all these issues again, see #1518116: [meta] Make Core pass Coder Review for more details
Comment #12
visabhishek CreditAttribution: visabhishek commentedHi,
Please find the updated patch and review.
Comment #13
TravisCarden CreditAttribution: TravisCarden commentedThanks, @visabhishek! A few comments:
We'd better leave this alone. I assume Coder Sniffer complained about it--and rightly so, because it's not a proper use of the translation system--but removing it will have functional changes.
Per Drupal coding standards, "In a class, if you are overriding or implementing a method from a base class or interface, and the documentation should be exactly the same as the base class/interface method, use the following docblock syntax:"
This one, too, of course:
The correct way to break and indent this would actually be like so:
inheritdoc again.
There's also one valid error left after the above patch. (There are two warnings that should be ignored.) Here's another patch to bring it home.
Comment #14
visabhishek CreditAttribution: visabhishek commentedThanks TravisCarden, i will update my other patches as per your comment #13.
Comment #15
roderikRe-tagging for sprint.
Comment #16
roderikComment #17
dankh CreditAttribution: dankh commentedWe are working on it @dankh, @leonevers.
Comment #18
xjmThanks for all the work here so far. See #1518116-86: [meta] Make Core pass Coder Review. This issue is postponed until the meta issue is either closed or reopened.
Comment #19
pfrenssenClosing in favor of #2571965: [meta] Fix PHP coding standards in core. In this issue the coding standards will be fixed on a sniff-per-sniff basis rather than a module-per-module basis.