Fix the issues reported by phpcs

Created on 5 September 2018, almost 6 years ago
Updated 12 February 2024, 5 months ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig reports the following warnings/errors, which needs to be fixed, where possible.

FILE: ./views_custom_cache_tag_8.x-1.x/tests/src/Functional/CustomCacheTagsTest.php
  28 | ERROR   | [x] Short array syntax must be used to define arrays
  33 | WARNING | [x] A comma should follow the last multiline array item. Found: 'views_custom_cache_tag_demo'
  41 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  42 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  43 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  44 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  45 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  46 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  47 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  48 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  49 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  50 | ERROR   | [x] Expected 2 space(s) before asterisk; 3 found
  87 | ERROR   | [ ] The array declaration extends to column 162 (the limit is 80). The array content should be split up over
     |         |     multiple lines
  87 | ERROR   | [x] Short array syntax must be used to define arrays
  88 | ERROR   | [ ] The array declaration extends to column 173 (the limit is 80). The array content should be split up over
     |         |     multiple lines
  88 | ERROR   | [x] Short array syntax must be used to define arrays
  95 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 101 | ERROR   | [x] Array closing indentation error, expected 4 spaces but found 12
 111 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 122 | ERROR   | [x] Short array syntax must be used to define arrays
 122 | ERROR   | [x] Short array syntax must be used to define arrays
 134 | ERROR   | [x] Short array syntax must be used to define arrays
 134 | ERROR   | [x] Short array syntax must be used to define arrays
 148 | ERROR   | [x] Short array syntax must be used to define arrays
 148 | ERROR   | [x] Short array syntax must be used to define arrays
 148 | ERROR   | [x] Short array syntax must be used to define arrays
 148 | ERROR   | [x] Short array syntax must be used to define arrays
 155 | ERROR   | [x] Short array syntax must be used to define arrays
 155 | ERROR   | [x] Short array syntax must be used to define arrays
 155 | ERROR   | [x] Short array syntax must be used to define arrays
 155 | ERROR   | [x] Short array syntax must be used to define arrays
 170 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 180 | ERROR   | [x] Short array syntax must be used to define arrays
 181 | ERROR   | [x] Short array syntax must be used to define arrays
 181 | ERROR   | [x] Short array syntax must be used to define arrays
 181 | ERROR   | [x] Short array syntax must be used to define arrays
 183 | ERROR   | [x] Short array syntax must be used to define arrays
 183 | ERROR   | [x] Short array syntax must be used to define arrays
 194 | WARNING | [x] A comma should follow the last multiline array item. Found: 'user_view'
 197 | ERROR   | [x] Short array syntax must be used to define arrays
 197 | ERROR   | [x] Short array syntax must be used to define arrays
 197 | ERROR   | [x] Short array syntax must be used to define arrays
 197 | ERROR   | [x] Short array syntax must be used to define arrays
 205 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 207 | ERROR   | [x] Short array syntax must be used to define arrays
 210 | ERROR   | [x] Short array syntax must be used to define arrays
 210 | ERROR   | [x] Short array syntax must be used to define arrays
 210 | ERROR   | [x] Short array syntax must be used to define arrays
 218 | ERROR   | [x] Short array syntax must be used to define arrays
 219 | ERROR   | [x] Short array syntax must be used to define arrays
 226 | ERROR   | [x] Short array syntax must be used to define arrays
 226 | ERROR   | [x] Short array syntax must be used to define arrays
 226 | ERROR   | [x] Short array syntax must be used to define arrays
 227 | ERROR   | [x] Short array syntax must be used to define arrays
 227 | ERROR   | [x] Short array syntax must be used to define arrays
 227 | ERROR   | [x] Short array syntax must be used to define arrays
 238 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 238 | ERROR   | [x] Expected "array|false" but found "array|FALSE" for parameter type
 244 | ERROR   | [ ] The array declaration extends to column 141 (the limit is 80). The array content should be split up over
     |         |     multiple lines
 244 | ERROR   | [x] Short array syntax must be used to define arrays
 249 | ERROR   | [x] Short array syntax must be used to define arrays
 257 | ERROR   | [x] Expected 1 blank line after function; 0 found
 258 | ERROR   | [x] The closing brace for the class must have an empty line before it

FILE: ./views_custom_cache_tag_8.x-1.x/modules/demo/views_custom_cache_tag_demo.info.yml
 4 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
 5 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
 6 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
 7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
 8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
 9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"

FILE: ./views_custom_cache_tag_8.x-1.x/modules/demo/views_custom_cache_tag_demo.module
 16 | ERROR | [x] Short array syntax must be used to define arrays

FILE: ./views_custom_cache_tag_8.x-1.x/src/Plugin/views/cache/CustomTag.php
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  32 | ERROR   | [ ] Missing @var tag in member variable comment
  47 | ERROR   | [x] Short array syntax must be used to define arrays
  57 | ERROR   | [x] Short array syntax must be used to define arrays
  65 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
  68 | ERROR   | [x] Short array syntax must be used to define arrays
  69 | ERROR   | [x] Short array syntax must be used to define arrays
  79 | ERROR   | [x] Short array syntax must be used to define arrays
  83 | ERROR   | [x] Short array syntax must be used to define arrays
  92 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 107 | WARNING | [ ] Unused variable $table.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇺🇦Ukraine AstonVictor

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024