Drupal Coding Standards Issues | phpcs

Created on 26 December 2022, over 1 year ago
Updated 20 June 2024, 7 days ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/search_api_spellcheck/search_api_spellcheck.module
----------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
19 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: /app/modules/contrib/search_api_spellcheck/search_api_spellcheck.views.inc
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
12 | WARNING | [x] '@todo: Only enable for search api views.' should match the format '@todo Fix problem X here.'
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/search_api_spellcheck/src/Plugin/views/area/DidYouMeanSpellCheck.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
98 | ERROR | [x] Data types in @var tags need to be fully namespaced
141 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
147 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
210 | ERROR | [x] Expected 1 blank line after function; 0 found
211 | 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: /app/modules/contrib/search_api_spellcheck/src/Plugin/views/area/SuggestionsSpellCheck.php
------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 7 LINES
------------------------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
49 | ERROR | [x] Data types in @var tags need to be fully namespaced
109 | ERROR | [x] There should be no white space before a closing ")"
109 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
110 | ERROR | [x] There should be no white space after an opening "("
146 | ERROR | [x] Expected 1 space after "-"; 0 found
165 | ERROR | [x] Expected 1 blank line after function; 0 found
166 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

Time: 8.21 secs; Memory: 10MB

Steps to reproduce

Run following command

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/search_api_spellcheck/

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024