Fix the errors/warnings reported by PHP_CodeSniffer

Created on 22 August 2024, 3 months ago
Updated 26 August 2024, 3 months ago

PHPCS issues found after running the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig environment_indicator

FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/css/environment_indicator.css
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------------
 18 | ERROR | [x] Opening brace should be the last content on the line
 18 | ERROR | [x] Closing brace of class definition must be on new line
 19 | ERROR | [x] Opening brace should be the last content on the line
 19 | ERROR | [x] Closing brace of class definition must be on new line
 20 | ERROR | [x] Opening brace should be the last content on the line
 20 | ERROR | [x] Closing brace of class definition must be on new line
 22 | ERROR | [x] Opening brace should be the last content on the line
 22 | ERROR | [x] Each style definition must be on a line by itself
 22 | ERROR | [x] Closing brace of class definition must be on new line
 41 | ERROR | [x] CSS colours must be defined in lowercase; expected #ddd but found #DDD
 55 | ERROR | [x] CSS colours must be defined in lowercase; expected #edede0 but found #EDEDE0
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------


FILE: .../jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/modules/environment_indicator_ui/src/Form/EnvironmentIndicatorUISettingsForm.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/environment_indicator.module
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------
  11 | WARNING | [x] Unused use statement
 173 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/src/Form/EnvironmentIndicatorSettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
-----------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/src/Form/EnvironmentIndicatorDeleteForm.php
---------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Cache\Cache.
 59 | WARNING | [x] 'TODO: Figure out how to log stuff to the watchdog.' should match the format '@todo Fix problem X here.'
---------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/src/EnvironmentIndicatorForm.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
 17 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/src/EnvironmentIndicatorPermissions.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
  7 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
 11 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 28 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
 30 | ERROR   | [ ] Missing parameter comment
 41 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 42 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 44 | ERROR   | [x] Expected 1 blank line after function; 0 found
 45 | ERROR   | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/src/EnvironmentIndicatorListBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------
 35 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/Contributions/recommended-project/web/modules/contrib/environment_indicator/src/ToolbarHandler.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 9 LINES
------------------------------------------------------------------------------------------------------------------------------
 104 | ERROR | [x] Expected 1 blank line after function; 2 found
 110 | ERROR | [ ] Description for the @return value is missing
 119 | ERROR | [ ] Missing parameter comment
 119 | ERROR | [ ] Missing parameter type
 121 | ERROR | [ ] Description for the @return value is missing
 130 | ERROR | [ ] Description for the @return value is missing
 215 | ERROR | [ ] Description for the @return value is missing
 234 | ERROR | [ ] Description for the @return value is missing
 245 | ERROR | [ ] Missing parameter type
 278 | ERROR | [ ] Description for the @return value is missing
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

Time: 420ms; Memory: 12MB
📌 Task
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

🇵🇭Philippines paraderojether

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