Fix the warnings/errors reported by PHP_CodeSniffer

Created on 10 July 2023, over 1 year ago

Problem/Motivation

FILE: /home/lenovo/d7to9/web/modules/contrib/field_group_bootstrap/field_group_bootstrap.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 31 ERRORS AND 1 WARNING AFFECTING 14 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  11 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Routing\RouteMatchInterface.
  65 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  65 | ERROR   | [x] There should be no white space before a closing ")"
  65 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 121 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 121 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 167 | ERROR   | [x] Expected 1 blank line after function; 0 found
 171 | ERROR   | [x] Additional blank lines found at end of doc comment
 172 | ERROR   | [ ] All functions defined in a module file must be prefixed with the module's name, found "_set_label_floating" but expected
     |         |     "field_group_bootstrap__set_label_floating"
 172 | ERROR   | [x] Expected 1 space before opening brace; found 0
 175 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 175 | ERROR   | [x] Expected one space after the comma, 0 found
 175 | ERROR   | [ ] The array declaration extends to column 135 (the limit is 80). The array content should be split up over multiple lines
 175 | ERROR   | [x] Expected 1 space between comma and "'radio'"; 0 found
 175 | ERROR   | [x] Expected one space after the comma, 0 found
 175 | ERROR   | [x] Expected 1 space between comma and "'checkboxes'"; 0 found
 175 | ERROR   | [x] Expected one space after the comma, 0 found
 175 | ERROR   | [x] Expected 1 space between comma and "'radios'"; 0 found
 175 | ERROR   | [x] Expected one space after the comma, 0 found
 175 | ERROR   | [x] Expected 1 space between comma and "'text_format'"; 0 found
 175 | ERROR   | [x] Expected one space after the comma, 0 found
 175 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 178 | ERROR   | [x] Expected 1 space between comma and ""target_id""; 0 found
 178 | ERROR   | [x] Expected one space after the comma, 0 found
 186 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 186 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 209 | ERROR   | [ ] All functions defined in a module file must be prefixed with the module's name, found "set_theme_wrapper_horizontal_form" but expected
     |         |     "field_group_bootstrap_set_theme_wrapper_horizontal_form"
 238 | ERROR   | [ ] All functions defined in a module file must be prefixed with the module's name, found "set_theme_wrapper_grid" but expected
     |         |     "field_group_bootstrap_set_theme_wrapper_grid"
 240 | ERROR   | [x] Space found before square bracket; expected "$grid[" but found "$grid ["
 247 | WARNING | [ ] Hook implementations should not duplicate @param documentation
 247 | ERROR   | [ ] Missing parameter comment
 270 | ERROR   | [ ] All functions defined in a module file must be prefixed with the module's name, found "hide_form_title" but expected
     |         |     "field_group_bootstrap_hide_form_title"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 25 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/field_group_bootstrap/src/Plugin/field_group/FieldGroupFormatter/BootstrapHorizontalForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Html.
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/field_group_bootstrap/src/Plugin/field_group/FieldGroupFormatter/BootstrapAccordion.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\field\Entity\FieldConfig.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/field_group_bootstrap/src/Plugin/field_group/FieldGroupFormatter/BootstrapGrid.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Html.
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/field_group_bootstrap/templates/field-group-bootstrap-grid.html.twig
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 4 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

Time: 485ms; Memory: 14MB

Steps to reproduce

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

Proposed resolution

Remaining tasks

FILE: /home/lenovo/d7to9/web/modules/contrib/field_group_bootstrap/field_group_bootstrap.module
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
 172 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "_set_label_floating" but expected
     |       | "field_group_bootstrap__set_label_floating"
 175 | ERROR | The array declaration extends to column 141 (the limit is 80). The array content should be split up over multiple lines
 209 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "set_theme_wrapper_horizontal_form" but
     |       | expected "field_group_bootstrap_set_theme_wrapper_horizontal_form"
 238 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "set_theme_wrapper_grid" but expected
     |       | "field_group_bootstrap_set_theme_wrapper_grid"
 268 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "hide_form_title" but expected
     |       | "field_group_bootstrap_hide_form_title"
-------------------------------------------------------------------------------------------------------------------------------------------------

Time: 487ms; Memory: 14MB

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: works as designed

Version

3.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.71.5 2024