Fix the issues reported by phpcs

Created on 8 January 2024, 10 months ago
Updated 8 February 2024, 9 months ago

Problem/Motivation

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/commerce_adyen_drop_in/js/drop-in.js
-------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Space before opening parenthesis of function call prohibited
14 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/commerce_adyen_drop_in/src/PluginForm/OffsiteRedirect/PaymentOffsiteForm.php
-----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Adyen\Environment.
11 | ERROR | [x] Missing class doc comment
24 | ERROR | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 2 spaces
27 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
39 | ERROR | [x] Expected 1 space after "=>"; 2 found
52 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
75 | ERROR | [x] Opening brace should be on the same line as the declaration
83 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
-----------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/commerce_adyen_drop_in/src/Plugin/Commerce/PaymentGateway/DropIn.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 58 ERRORS AND 8 WARNINGS AFFECTING 58 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Adyen\Service\Checkout.
18 | ERROR | [x] When importing a class with "use", do not include a leading \
36 | ERROR | [x] Opening brace should be on the same line as the declaration
46 | ERROR | [x] Doc comment short description must end with a full stop
69 | ERROR | [x] Opening brace should be on the same line as the declaration
74 | ERROR | [x] Expected 1 blank line after function; 2 found
89 | ERROR | [x] Opening brace should be on the same line as the declaration
101 | ERROR | [x] Opening brace should be on the same line as the declaration
249 | ERROR | [x] Opening brace should be on the same line as the declaration
266 | ERROR | [x] Missing function doc comment
278 | ERROR | [ ] Missing parameter comment
278 | ERROR | [x] Data types in @param tags need to be fully namespaced
279 | ERROR | [ ] Missing parameter comment
280 | ERROR | [x] Separate the @param and @return sections by a blank line.
280 | ERROR | [ ] Description for the @return value is missing
283 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
290 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
291 | ERROR | [x] Expected 1 space after "="; 2 found
293 | WARNING | [x] 'TODO: Add Line Items - lineItems' should match the format '@todo Fix problem X here.'
293 | WARNING | [x] There must be no blank line following an inline comment
293 | WARNING | [ ] There must be no blank line following an inline comment
293 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
297 | ERROR | [x] Short array syntax must be used to define arrays
298 | ERROR | [x] Short array syntax must be used to define arrays
305 | ERROR | [x] Expected 1 space after "=>"; 2 found
306 | ERROR | [x] Short array syntax must be used to define arrays
310 | ERROR | [x] Short array syntax must be used to define arrays
324 | WARNING | [x] A comma should follow the last multiline array item. Found: $return_url
329 | ERROR | [x] Expected newline after closing brace
340 | ERROR | [x] Opening brace should be on the same line as the declaration
356 | ERROR | [x] Opening brace should be on the same line as the declaration
425 | ERROR | [x] Opening brace should be on the same line as the declaration
443 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
449 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
455 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
459 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
466 | ERROR | [x] Expected 1 space after SWITCH keyword; 0 found
472 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
476 | ERROR | [x] Case breaking statements must be followed by a single blank line
477 | WARNING | [ ] Code after the THROW statement on line 476 cannot be executed
477 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
480 | ERROR | [x] Case breaking statements must be followed by a single blank line
481 | WARNING | [ ] Code after the THROW statement on line 480 cannot be executed
481 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
485 | WARNING | [ ] Code after the THROW statement on line 484 cannot be executed
485 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
487 | ERROR | [x] Expected newline after closing brace
497 | ERROR | [x] Opening brace should be on the same line as the declaration
498 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
504 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
510 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
513 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
516 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
520 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
526 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
533 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
540 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
548 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
551 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
555 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
558 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
561 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
578 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
607 | ERROR | [x] Expected newline after closing brace
615 | ERROR | [x] Expected newline after closing brace
621 | ERROR | [x] Expected 1 blank line after function; 0 found
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 58 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

Time: 346ms; Memory: 14MB

Steps to reproduce

Use command with arguments:- ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/commerce_adyen_drop_in

Proposed resolution

Fix all the isssue reported by PHPCS

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Ashutosh Ahirwal India

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

Merge Requests

Comments & Activities

  • Issue created by @Ashutosh Ahirwal
  • Merge request !1Providing fixes for phpcs issue. → (Open) created by Ashutosh Ahirwal
  • Status changed to Needs review 10 months ago
  • 🇮🇳India Ashutosh Ahirwal India

    Providing patch with fixes.
    Please review it.

    Remaining warnings are there
    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/commerce_adyen_drop_in

    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/commerce_adyen_drop_in/src/Plugin/Commerce/PaymentGateway/DropIn.php
    ---------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------
    477 | WARNING | Code after the THROW statement on line 475 cannot be executed
    482 | WARNING | Code after the THROW statement on line 480 cannot be executed
    486 | WARNING | Code after the THROW statement on line 485 cannot be executed
    ---------------------------------------------------------------------------------------------------------------------------------------------

    Time: 224ms; Memory: 14MB

  • 🇬🇧United Kingdom bdziewierz

    Hi! Thanks for that. Would you mind to rebase and reroll? There seem to be conflicts on latest dev.

  • Status changed to Fixed 10 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024