Fix the issues reported by phpcs

Created on 27 March 2023, over 1 year ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/config/schema/tax_number.schema.yml
--------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/README.md
------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------
37 | WARNING | Line exceeds 80 characters; contains 93 characters
49 | WARNING | Line exceeds 80 characters; contains 117 characters
50 | WARNING | Line exceeds 80 characters; contains 130 characters
51 | WARNING | Line exceeds 80 characters; contains 212 characters
52 | WARNING | Line exceeds 80 characters; contains 140 characters
------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/TaxNumber/Widget/SpanishWidget.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] There must not be a single space before a unary operator statement
33 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
36 | ERROR | [x] Expected newline after closing brace
50 | ERROR | [x] Expected newline after closing brace
58 | ERROR | [x] Expected newline after closing brace
66 | ERROR | [x] Expected newline after closing brace
72 | ERROR | [x] Short array syntax must be used to define arrays
72 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
72 | ERROR | [x] Expected 1 space between comma and "'Y'"; 0 found
72 | ERROR | [x] Expected one space after the comma, 0 found
72 | ERROR | [x] Expected 1 space between comma and "'Z'"; 0 found
72 | ERROR | [x] Expected one space after the comma, 0 found
72 | ERROR | [x] Short array syntax must be used to define arrays
72 | ERROR | [ ] The array declaration extends to column 114 (the limit is 80). The array content should be split up over multiple lines
72 | ERROR | [x] Expected 1 space between comma and "'1'"; 0 found
72 | ERROR | [x] Expected one space after the comma, 0 found
72 | ERROR | [x] Expected 1 space between comma and "'2'"; 0 found
72 | ERROR | [x] Expected one space after the comma, 0 found
74 | ERROR | [x] Expected newline after closing brace
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/WebformElement/WebformTaxNumberElement.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------
53 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
62 | WARNING | [ ] Possible useless method overriding detected
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/Field/FieldWidget/TaxNumberWidget.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 1 WARNING AFFECTING 11 LINES
---------------------------------------------------------------------------------------------------------------------------------
64 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
68 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
69 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
70 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
71 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
72 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
73 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
104 | ERROR | [x] Expected 1 blank line after function; 2 found
121 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
137 | ERROR | [x] Expected 1 blank line after function; 0 found
138 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/Field/FieldType/TaxNumberItem.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------
39 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
45 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/Field/FieldFormatter/TaxNumberDefaultFormatter.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Expected 1 blank line before function; 2 found
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/TaxNumberWidgetBase.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
18 | WARNING | [ ] Possible useless method overriding detected
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Plugin/TaxNumberWidgetManager.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
32 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/techx/docroot/modules/custom/tax_number/src/Element/WebformTaxNumber.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
85 | ERROR | The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

Time: 184ms; Memory: 12MB

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India ashutosh ahirwal India

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @ashutosh ahirwal
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India ashutosh ahirwal India

    Providing Patch for review.

  • Status changed to Needs work over 1 year ago
  • 🇮🇳India rajneeshb New Delhi

    Reviewed patch #2, patch applied cleanly. After applying patch there is still one coding standard issue

    /modules/contrib/tax_number/src/Plugin/Field/FieldWidget/TaxNumberWidget.php
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------
    110 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    ---------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------

    by using this command
    phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India rajneeshb New Delhi

    Adding patch to fix the remaining coding standard issues.

  • Assigned to TiagoZ
  • Status changed to RTBC over 1 year ago
  • 🇮🇳India saket-001

    after applying the patch there is no PHPCS error is found sharing the SS. thanks @ rajneeshb for the patch.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇵🇹Portugal TiagoZ

    Thanks a lot for the patch. We just needed to solve a minor fix, because it was throwing an error on the edit form.

  • Status changed to Fixed over 1 year ago
  • 🇵🇹Portugal TiagoZ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024