Fix the warnings/errors reported by PHP_CodeSniffer

Created on 7 July 2023, 12 months ago

Problem/Motivation

FILE: /home/lenovo/d7to9/web/modules/contrib/webform_newsletter2go/src/Plugin/WebformHandler/DoubleOptInHandler.php
-------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 9 WARNINGS AFFECTING 23 LINES
-------------------------------------------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
   6 | WARNING | [x] Unused use statement
   7 | WARNING | [x] Unused use statement
   9 | WARNING | [x] Unused use statement
  10 | WARNING | [x] Unused use statement
  12 | WARNING | [x] Unused use statement
  13 | WARNING | [x] Unused use statement
  15 | WARNING | [x] Unused use statement
  16 | WARNING | [x] Unused use statement
  88 | ERROR   | [x] Expected 1 blank line before function; 2 found
  90 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  92 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  93 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  94 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  95 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  96 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  97 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  98 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  99 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 100 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 101 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 103 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 105 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 23 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/webform_newsletter2go/src/Form/Newsletter2GoForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/webform_newsletter2go/src/PostManager.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactory.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/d7to9/web/modules/contrib/webform_newsletter2go/src/PostManagerInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
 9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

Time: 123ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig webform_newsletter2go/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India roshni27

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