Fix the errors/warnings reported by Php_CodeSniffer

Created on 5 July 2023, over 1 year ago
Updated 21 November 2023, about 1 year ago

Problem/Motivation

C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig language_neutral_aliases

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\language_neutral_aliases\language_neutral_aliases.module
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 19 | WARNING | [x] The variable name should be defined after the type
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\language_neutral_aliases\language_neutral_aliases.stubs.inc
-----------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  3 | ERROR | [x] Doc comment short description must be on the first line
  3 | ERROR | [x] Doc comment short description must end with a full stop
 16 | ERROR | [x] Missing class doc comment
 16 | ERROR | [ ] Namespaced classes/interfaces/traits should be referenced with use statements
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\language_neutral_aliases\src\AliasRepositoryDecorator.php
----------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 30 | ERROR | [ ] Parameter $connection is not described in comment
 32 | ERROR | [x] Expected 1 space after asterisk; 0 found
 32 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 33 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
 37 | ERROR | [ ] Missing parameter name
 40 | ERROR | [ ] Type hint "\Drupal\path_alias\AliasRepository" missing for $repository
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\language_neutral_aliases\src\NeutralPathAliasListBuilder.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\language_neutral_aliases\src\NeutralPathAliasStorage.php
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\language_neutral_aliases\tests\src\Kernel\LanguageNeutralAliasesTest.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 138 | ERROR | [ ] The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines
 140 | ERROR | [ ] The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.22 secs; Memory: 6MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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