Fix the errors/warnings reported by Php_CodeSniffer

Created on 6 July 2023, 12 months ago
Updated 13 October 2023, 8 months ago

Problem/Motivation

PHPCS finds the following errors:

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 prevnext

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\prevnext\prevnext.module
------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
26 | ERROR | [x] Whitespace found at end of line
36 | ERROR | [x] Whitespace found at end of line
46 | ERROR | [x] Whitespace found at end of line
55 | ERROR | [x] Whitespace found at end of line
58 | ERROR | [x] Whitespace found at end of line
75 | ERROR | [x] Whitespace found at end of line
83 | ERROR | [x] Whitespace found at end of line
90 | ERROR | [x] Whitespace found at end of line
104 | ERROR | [x] Whitespace found at end of line
117 | ERROR | [x] Whitespace found at end of line
130 | ERROR | [x] Whitespace found at end of line
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\prevnext\prevnext.permissions.yml
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\prevnext\src\Form\PrevNextSettingsForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
49 | WARNING | [ ] Possible useless method overriding detected
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\prevnext\src\PrevNextService.php
---------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
33 | ERROR | [x] Data types in @param tags need to be fully namespaced
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\prevnext\src\PrevNextServiceInterface.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
11 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

Time: 909ms; Memory: 6MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

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

Comments & Activities

Production build 0.69.0 2024