Fix phpcs errors

Created on 29 June 2023, over 1 year ago
Updated 4 July 2023, over 1 year ago

Problem/Motivation

These are the errors to fix:

FILE: /var/www/html/web/modules/custom/rabbit_hole_href/src/Plugin/RabbitHoleBehaviorPlugin/PageRedirectHref.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 14 WARNINGS AFFECTING 20 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
  8 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
  9 | WARNING | [x] Unused use statement
 10 | WARNING | [x] Unused use statement
 11 | WARNING | [x] Unused use statement
 13 | WARNING | [x] Unused use statement
 14 | WARNING | [x] Unused use statement
 17 | WARNING | [x] Unused use statement
 19 | WARNING | [x] Unused use statement
 20 | WARNING | [x] Unused use statement
 21 | WARNING | [x] Unused use statement
 22 | WARNING | [x] Unused use statement
 23 | WARNING | [x] Unused use statement
 38 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 40 | ERROR   | [ ] Missing parameter comment
 40 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 41 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 41 | ERROR   | [ ] Description for the @return value is missing
 43 | ERROR   | [x] Expected 1 space before opening brace; found 0
 44 | WARNING | [x] 'TODO: Write  a Drupal.org issue to make this part a' should match the format '@todo Fix problem X here.'
 47 | WARNING | [x] There must be no blank line following an inline comment
 47 | WARNING | [ ] There must be no blank line following an inline comment
 92 | ERROR   | [x] Expected 1 blank line after function; 0 found
 93 | ERROR   | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/rabbit_hole_href/src/CanonicalLinkModifierInterface.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"
 9 | 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
--------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/rabbit_hole_href/src/CanonicalLinkModifier.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 38 ERRORS AND 2 WARNINGS AFFECTING 36 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityInterface.
  6 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
 13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 30 | ERROR   | [x] Missing function doc comment
 30 | ERROR   | [x] Expected 1 space before opening brace; found 0
 31 | WARNING | [x] 'TODO' should match the format '@todo Fix problem X here.'
 31 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 35 | ERROR   | [x] Missing function doc comment
 35 | ERROR   | [x] Expected 1 space before opening brace; found 0
 38 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 39 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 40 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 41 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 42 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 43 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 44 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 45 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 46 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 47 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 48 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 49 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 50 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 51 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 52 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 53 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 54 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 55 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 56 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 57 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 58 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 59 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 60 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 61 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 62 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 63 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 2
 64 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 0
 65 | ERROR   | [x] Line indented incorrectly; expected 5 spaces, found 4
 67 | ERROR   | [x] Expected 1 blank line after function; 0 found
 68 | ERROR   | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 39 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/rabbit_hole_href/rabbit_hole_href.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------FOUND 14 ERRORS AND 11 WARNINGS AFFECTING 17 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  3 | ERROR   | [x] You must use "/**" style comments for a file comment
  4 | WARNING | [x] 'TODO: See /core/modules/views/src/Plugin/views/field/LinkBase.php' should match the format '@todo Fix problem X here.'
  4 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 1
  5 | WARNING | [x] 'TODO: See https://drupal.stackexchange.com/questions/218824/how-to-alter-node-url-or-tourl-function-output' should match the format '@todo Fix problem X  
    |         |     here.'
  5 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 1
  6 | WARNING | [x] 'TODO: Implement service' should match the format '@todo Fix problem X here.'
  6 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 1
  7 | ERROR   | [x] Line indented incorrectly; expected 1 spaces, found 0
 10 | WARNING | [x] Unused use statement
 21 | WARNING | [x] 'TODO - run this for all enabled entity types' should match the format '@todo Fix problem X here.'
 21 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 33 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 37 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
 37 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 45 | ERROR   | [x] Inline comments must start with a capital letter
 46 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
 48 | WARNING | [ ] Line exceeds 80 characters; contains 97 characters
 48 | WARNING | [x] There must be no blank line following an inline comment
 48 | WARNING | [ ] There must be no blank line following an inline comment
 53 | ERROR   | [x] Inline comments must start with a capital letter
 54 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
 56 | WARNING | [x] There must be no blank line following an inline comment
 56 | WARNING | [ ] There must be no blank line following an inline comment
 58 | ERROR   | [x] Inline comments must start with a capital letter
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

These should be fixed.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024