Coding Standard issues

Created on 18 September 2024, 2 months ago
Updated 19 September 2024, 2 months ago

Problem/Motivation

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

FILE: .../web/modules/custom/suppress_logs/config/schema/suppress_logs.schema.yml
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/suppress_logs/suppress_logs.info.yml
------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------
6 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/suppress_logs/src/Form/SuppressLogsSettingsForm.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
28 | ERROR | [x] Missing function doc comment
30 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
33 | ERROR | [x] Comments may not appear after statements
33 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
| | parentheses
58 | ERROR | [x] Expected 1 blank line after function; 0 found
59 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/suppress_logs/src/LoggerChannelFactory.php
------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------
47 | ERROR | [x] Expected 1 space after IF keyword; 0 found
50 | ERROR | [x] Whitespace found at end of line
64 | ERROR | [x] Expected 1 newline at end of file; 0 found
64 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/suppress_logs/suppress_logs.services.yml
----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/suppress_logs/suppress_logs.module
--------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 1 WARNING AFFECTING 9 LINES
--------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
35 | ERROR | [x] Expected 1 blank line after function; 2 found
43 | ERROR | [x] Expected 1 blank line after function; 0 found
44 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
45 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
45 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
49 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
51 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
51 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡΅πŸ‡ͺPeru alyaj2a

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