Fix issues reported by phpcs

Created on 30 June 2024, 5 months ago
Updated 2 July 2024, 5 months ago

I ran this following phpcs command and errors were reported below.

phpcs \
--standard=Drupal,DrupalPractice -n \
--extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig \
--ignore="*.features.*,*.pages*.inc,*/node_modules/*" \
web/modules/contrib/webp
FILE: /webp/webp.module
---------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------
 113 | ERROR | [x] Comments may not appear after statements
 114 | ERROR | [x] Comments may not appear after statements
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------


FILE: /webp/src/Controller/ImageStyleDownloadController.php
---------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------------------
 165 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 165 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 3
 166 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 166 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 3
 167 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 167 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 3
 168 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 168 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
 168 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 168 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 169 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
 169 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 3
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /webp/src/Controller/FileDownloadController.php
---------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------
  14 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
  17 | ERROR | [x] Missing class doc comment
 101 | ERROR | [x] Separate the @throws and @see sections by a blank line.
 103 | ERROR | [x] Additional blank lines found at end of doc comment
 194 | ERROR | [ ] Parameter $uri is not described in comment
 197 | ERROR | [ ] Doc comment for parameter $image does not match actual variable name $scheme
 213 | ERROR | [x] Expected 1 blank line after function; 2 found
 216 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------


FILE: /webp/src/Webp.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------
   9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\File\FileSystemInterface.
  13 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
  48 | ERROR | [x] Expected "Drupal\Core\File\FileSystemInterface" but found "Drupal\Core\File\FileSystemInterface;" for @var tag in member variable comment
 181 | ERROR | [x] Parameter comment must end with a full stop
 206 | ERROR | [ ] Variable "ImageMagickImg" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 208 | ERROR | [ ] Variable "ImageMagickImg" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 208 | ERROR | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
 211 | ERROR | [ ] Variable "ImageMagickImg" starts with a capital letter, but only $lowerCamelCase or $snake_case is allowed
 233 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
 233 | ERROR | [ ] Missing parameter comment
 233 | ERROR | [ ] Missing parameter type
 234 | ERROR | [ ] Missing parameter comment
 234 | ERROR | [ ] Missing parameter type
 236 | ERROR | [ ] Description for the @return value is missing
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------
📌 Task
Status

RTBC

Component

Code

Created by

🇵🇭Philippines Zed9

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024