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.
Problem/Motivation
The project fails to adhere to the coding standards tested for by the coder module.
FILE: ...sites/drupal8alt.dev/modules/akamai/src/AkamaiAuthentication.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
6 | ERROR | [x] There must be exactly one blank line after the file
| | comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...isk/dev/sites/drupal8alt.dev/modules/akamai/src/AkamaiClient.php
----------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
----------------------------------------------------------------------
199 | ERROR | [ ] Comment indentation error, expected only 1 spaces
275 | ERROR | [ ] Return comment must be on the next line
277 | ERROR | [ ] Private method name "AkamaiClient::_getQueue" is
| | not in lowerCamel format
313 | ERROR | [x] Missing function doc comment
317 | ERROR | [x] Missing function doc comment
327 | ERROR | [x] Missing function doc comment
337 | ERROR | [x] Missing function doc comment
347 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...ites/drupal8alt.dev/modules/akamai/src/Form/CacheControlForm.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------
33 | ERROR | Missing parameter name
36 | ERROR | Variable "akamaiClient" is camel caps format. do not
| | use mixed case (camelCase), use lower case and _
37 | ERROR | Variable "akamaiClient" is camel caps format. do not
| | use mixed case (camelCase), use lower case and _
152 | WARNING | Translatable strings must not begin or end with
| | white spaces, use placeholders with t() for
| | variables
170 | ERROR | If the line declaring an array spans longer than 80
| | characters, each element should be broken into its
| | own line
184 | WARNING | Only string literals should be passed to t() where
| | possible
----------------------------------------------------------------------
FILE: .../dev/sites/drupal8alt.dev/modules/akamai/src/Form/ConfigForm.php
----------------------------------------------------------------------
FOUND 17 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
----------------------------------------------------------------------
44 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
44 | ERROR | [x] Comment indentation error after @todo element,
| | expected 3 spaces
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
45 | ERROR | [ ] Comment indentation error, expected only 4
| | spaces
46 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
47 | WARNING | [ ] Line exceeds 80 characters; contains 133
| | characters
47 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
48 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
49 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
50 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
51 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
51 | ERROR | [ ] Comment indentation error, expected only 4
| | spaces
52 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
53 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
54 | WARNING | [x] There must be no blank line following an inline
| | comment
54 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 0
54 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, colons, or question marks
169 | ERROR | [x] No space found before comment text; expected "//
| | ->set('disabled', $values['disabled'])" but
| | found "//->set('disabled', $values['disabled'])"
169 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, colons, or question marks
----------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
FILE: ...s/drupal8alt.dev/modules/akamai/src/Tests/AkamaiHomepageTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
71 | WARNING | Do not concatenate strings to translatable strings,
| | they should be part of the t() argument and you
| | should use placeholders
----------------------------------------------------------------------
Time: 332ms; Memory: 8.75Mb
Proposed resolution
Fix where possible all the code style issues. After applying the patch there are no fails.
Remaining tasks
User interface changes
Some strings are made properly translatable.
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#2 | 2685715.2.patch | 9.12 KB | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottAs automated tests are not being run here is a local run...
Comment #4
alexpottHere are some notes on the more functional changes in the patch...
Note that splitting the sentence here actually makes this impossible to translate in many languages... the solution is to give the translator the full context. Also concatenating strings which possibly contain markup is not advised - and yes in order to translate a string properly it can be necessary to add markup.
So localise.d.o can't pick up this string so without this change translators will never get to translate it.
Comment #5
Cameron Tod CreditAttribution: Cameron Tod at Acquia commentedLooks great, committed, thanks!