Fix the issues reported by PHP_CodeSniffer

Created on 25 September 2024, about 2 months ago

Problem/Motivation

FILE: layout_builder_awesome_sections\css\style.css
---------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------
5 | ERROR | [x] Multiple selectors should each be on a single line
5 | ERROR | [x] Multiple selectors should each be on a single line
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------

FILE: layout_builder_awesome_sections\layout_builder_awesome_sections.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

FILE: layout_builder_awesome_sections\layout_builder_awesome_sections.layouts.yml
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
75 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------

FILE: layout_builder_awesome_sections\layout_builder_awesome_sections.module
----------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
12 | ERROR | [x] Concat operator must be surrounded by a single space
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

FILE: layout_builder_awesome_sections\src\Plugin\Layout\AwesomeLayout.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 16 ERRORS AND 4 WARNINGS AFFECTING 15 LINES
---------------------------------------------------------------------------------------------------------------------------------------
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
15 | ERROR | [x] Additional blank lines found at end of doc comment
101 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
109 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
119 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
119 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
125 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
149 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
178 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
186 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
199 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
199 | ERROR | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
366 | ERROR | [x] 4 spaces found before inline comment; expected "// $build['#attributes']['style'] = ["display:flex;"];" but found
| | "// $build['#attributes']['style'] = ["display:flex;"];"
384 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
384 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 0
384 | ERROR | [x] 8 spaces found before inline comment; expected "// $build['#attributes']['style'][] = 'background-image:url(' .
| | $image->createFileUrl() . ');';" but found "// $build['#attributes']['style'][] = 'background-image:url('
| | . $image->createFileUrl() . ');';"
385 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 0
386 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 0
387 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 0
460 | ERROR | [x] Missing function doc comment
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇺🇸United States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

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