Fix phpcs Drupal.WhiteSpace, Squiz.WhiteSpace issues

Created on 1 January 2024, 11 months ago
Updated 30 January 2024, 10 months ago

Problem/Motivation

Fix phpcs errors for

  • Drupal.WhiteSpace.ScopeIndent
  • Drupal.WhiteSpace.OpenBracketSpacing
  • Drupal.WhiteSpace.CloseBracketSpacing
  • Squiz.WhiteSpace.FunctionSpacing
  • Squiz.WhiteSpace.SuperfluousWhitespace

Command:

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/custom/pathauto/ --sniffs="Drupal.WhiteSpace.ScopeIndent,Drupal.WhiteSpace.OpenBracketSpacing,Drupal.WhiteSpace.CloseBracketSpacing,Squiz.WhiteSpace.FunctionSpacing,Squiz.WhiteSpace.SuperfluousWhitespace"

Result:


FILE: tests/src/Functional/PathautoNodeWebTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 120 | ERROR | [x] There should be no white space after an opening "("
 263 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: tests/src/Functional/PathautoBulkUpdateTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: tests/src/Functional/PathautoEnablingEntityTypesTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 75 | ERROR | [x] There should be no white space before a closing ")"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: src/PathautoWidget.php
------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
------------------------------------------------------------------------
 27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 31 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 32 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
 38 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------


FILE: src/AliasCleaner.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 255 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 657ms; Memory: 8MB


Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇷🇺Russia zniki.ru

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024