Fix the warnings/errors reported by PHP_CodeSniffer

Created on 7 July 2023, 12 months ago
Updated 18 July 2023, 12 months ago

Problem/Motivation

FILE: ...e/lenovo/d7to9/web/modules/contrib/admin_toolbar_version/admin_toolbar_version.info.yml
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging
   |         | automatically
---------------------------------------------------------------------------------------------


FILE: .../web/modules/contrib/admin_toolbar_version/src/Form/AdminToolbarVersionSettingsForm.php
---------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 27 WARNINGS AFFECTING 31 LINES
---------------------------------------------------------------------------------------------
   8 | ERROR   | [x] Missing class doc comment
  35 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found
     |         |     "true"
  41 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found
     |         |     "false"
  45 | WARNING | [ ] #description values usually have to run through t() for translation
  46 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  51 | WARNING | [ ] #description values usually have to run through t() for translation
  52 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  57 | WARNING | [ ] #description values usually have to run through t() for translation
  63 | WARNING | [ ] #description values usually have to run through t() for translation
  64 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  69 | WARNING | [ ] #description values usually have to run through t() for translation
  70 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  71 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  82 | WARNING | [ ] #description values usually have to run through t() for translation
  83 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
  88 | WARNING | [ ] #description values usually have to run through t() for translation
  89 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
  94 | WARNING | [ ] #description values usually have to run through t() for translation
  95 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
 100 | WARNING | [ ] #description values usually have to run through t() for translation
 101 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
 106 | WARNING | [ ] #description values usually have to run through t() for translation
 107 | WARNING | [x] A comma should follow the last multiline array item. Found:
     |         |     '/.git/HEAD'
 108 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 112 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
     |         |     instead
 123 | WARNING | [ ] #description values usually have to run through t() for translation
 124 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
     |         |     instead
 124 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 139 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
     |         |     instead
 146 | ERROR   | [x] Expected 1 space after FUNCTION keyword; 0 found
 155 | ERROR   | [x] Expected 1 space after comma in argument list; 2 found
 155 | ERROR   | [x] Expected one space after the comma, 2 found
 160 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
     |         |     instead
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/admin_toolbar_version/src/VersionInfoManager.php
---------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 4 WARNINGS AFFECTING 18 LINES
---------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
  10 | ERROR   | [x] Missing class doc comment
  17 | ERROR   | [ ] Missing parameter comment
  18 | ERROR   | [ ] Missing parameter comment
  19 | ERROR   | [ ] Missing parameter comment
  31 | ERROR   | [ ] Description for the @return value is missing
  45 | ERROR   | [ ] Description for the @return value is missing
  51 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
  52 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
     |         |     instead
  67 | ERROR   | [ ] Description for the @return value is missing
  76 | ERROR   | [ ] Description for the @return value is missing
  96 | ERROR   | [ ] Description for the @return value is missing
 111 | ERROR   | [ ] Description for the @return value is missing
 119 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 135 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 142 | ERROR   | [x] Missing function doc comment
 143 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found
     |         |     "false"
 148 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection
     |         |     instead
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: ...ome/lenovo/d7to9/web/modules/contrib/admin_toolbar_version/admin_toolbar_version.module
---------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
 40 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements
    |         |     hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements
    |         |     hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
    |         |     hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements
    |         |     hook_foo_BAR_ID_bar() for block templates."
 40 | ERROR   | [ ] Doc comment short description must end with a full stop
 42 | ERROR   | [ ] Missing parameter comment
 53 | WARNING | [x] A comma should follow the last multiline array item. Found:
    |         |     "background:{$style['color']};"
 54 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

Time: 94ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig admin_toolbar_version/

Proposed resolution

Remaining tasks

FILE: /home/lenovo/d7to9/web/modules/contrib/admin_toolbar_version-3373107/src/VersionInfoManager.php
-----------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------
  64 | ERROR   | Description for the @return value is missing
  78 | ERROR   | Description for the @return value is missing
  85 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 100 | ERROR   | Description for the @return value is missing
 109 | ERROR   | Description for the @return value is missing
 129 | ERROR   | Description for the @return value is missing
 144 | ERROR   | Description for the @return value is missing
-----------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/admin_toolbar_version-3373107/admin_toolbar_version.module
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
 47 | WARNING | Hook implementations should not duplicate @param documentation
-------------------------------------------------------------------------------------------------------

Time: 106ms; Memory: 10MB

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India roshni27

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

Production build 0.69.0 2024