Drupal Coding Standards Issues | phpcs

Created on 18 January 2023, over 1 year ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=drupal ata_st

FILE: ...docs\drupal9.4\d9.4\web\modules\ata_st\src\Controller\HelperController.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 11 | ERROR | [x] Opening brace should be on the same line as the declaration
 12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 16 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
 18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 18 | ERROR | [x] Expected 1 blank line before function; 0 found
 19 | ERROR | [x] Opening brace should be on the same line as the declaration
 20 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 21 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
 23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 23 | ERROR | [x] Expected 1 blank line after function; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...pp\htdocs\drupal9.4\d9.4\web\modules\ata_st\src\Form\AlterSettingsForm.php
--------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  96 | ERROR | [x] Expected 1 space before "?"; 0 found
  96 | ERROR | [x] Expected 1 space after "?"; 0 found
  96 | ERROR | [x] Expected 1 space before ":"; 0 found
  96 | ERROR | [x] Expected 1 space after ":"; 0 found
  99 | ERROR | [x] Short array syntax must be used to define arrays
 103 | ERROR | [x] Expected 1 space before "?"; 0 found
 103 | ERROR | [x] Expected 1 space after "?"; 0 found
 103 | ERROR | [x] Expected 1 space before ":"; 0 found
 103 | ERROR | [x] Expected 1 space after ":"; 0 found
 121 | ERROR | [ ] Description for the @return value is missing
 132 | ERROR | [x] Whitespace found at end of line
 159 | ERROR | [x] Whitespace found at end of line
 164 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 413ms; Memory: 8MB

Proposed resolution

Fix the errors and warnings.

🐛 Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

🇮🇳India Jay Jangid

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