[2.x] Follow coding standards

Created on 29 January 2023, almost 2 years ago
Updated 7 February 2023, almost 2 years ago

Lots of coding standards violations.

FILE: ...pal10-site/web/modules/custom/commerce_valitor/js/commerce_valitor.form.js
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  15 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  62 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  71 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  71 | ERROR | [x] Expected 1 space before opening brace; found 0
 129 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...my-drupal10-site/web/modules/custom/commerce_valitor/src/ValitorPayApi.php
--------------------------------------------------------------------------------
FOUND 14 ERRORS AND 2 WARNINGS AFFECTING 16 LINES
--------------------------------------------------------------------------------
  12 | ERROR   | [x] Doc comment short description must end with a full stop
  13 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
  14 | WARNING | [ ] The class short comment should describe what the class
     |         |     does and not simply repeat the class name
  20 | ERROR   | [x] PHP keywords must be lowercase; expected "const" but found
     |         |     "CONST"
  25 | ERROR   | [x] PHP keywords must be lowercase; expected "const" but found
     |         |     "CONST"
  26 | ERROR   | [x] PHP keywords must be lowercase; expected "const" but found
     |         |     "CONST"
  74 | ERROR   | [ ] Parameter $logger is not described in comment
  77 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  81 | ERROR   | [x] Expected "int" but found "integer" for parameter type
  83 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 123 | ERROR   | [ ] Description for the @return value is missing
 175 | ERROR   | [ ] Public method name "ValitorPayApi::getEnvironmentURL" is
     |         |     not in lowerCamel format
 224 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 228 | ERROR   | [ ] Type hint "array" missing for $payload
 237 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ]
 241 | ERROR   | [x] Expected newline after closing brace
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...e/web/modules/custom/commerce_valitor/src/PluginForm/PaymentRefundForm.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 71 | ERROR | [x] Expected newline after closing brace
 72 | ERROR | [ ] The array declaration extends to column 140 (the limit is
    |       |     80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...b/modules/custom/commerce_valitor/src/PluginForm/PaymentMethodEditForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 6 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
 11 | ERROR   | [x] Missing class doc comment
 23 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 55 | WARNING | [ ] Exceptions should not be translated
 55 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 59 | WARNING | [ ] Exceptions should not be translated
 59 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 75 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...eb/modules/custom/commerce_valitor/src/PluginForm/PaymentMethodAddForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | The @see reference should not contain any additional text
--------------------------------------------------------------------------------


FILE: ...m/commerce_valitor/src/Plugin/Commerce/PaymentGateway/ValitorInterface.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
 21 | ERROR | [x] Expected "int" but found "integer" for parameter type
 23 | ERROR | [x] Expected "int" but found "integer" for parameter type
 25 | ERROR | [x] Expected "int" but found "integer" for parameter type
 27 | ERROR | [x] Expected "int" but found "integer" for parameter type
 32 | ERROR | [ ] Description for the @return value is missing
 39 | ERROR | [x] Data types in @param tags need to be fully namespaced
 42 | ERROR | [ ] Description for the @return value is missing
 44 | ERROR | [x] Expected 1 blank line after function; 0 found
 45 | ERROR | [x] The closing brace for the interface must have an empty line
    |       |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...les/custom/commerce_valitor/src/Plugin/Commerce/PaymentGateway/Valitor.php
--------------------------------------------------------------------------------
FOUND 31 ERRORS AND 7 WARNINGS AFFECTING 31 LINES
--------------------------------------------------------------------------------
  15 | WARNING | [x] Unused use statement
 173 | ERROR   | [ ] Description for the @return value is missing
 186 | ERROR   | [ ] Description for the @return value is missing
 202 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 220 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
 220 | ERROR   | [ ] The @see reference should not contain any additional text
 222 | ERROR   | [ ] Parameter tags must be defined first in a doc comment
 227 | ERROR   | [ ] Type hint "array" missing for $response
 280 | ERROR   | [ ] Description for the @return value is missing
 282 | ERROR   | [ ] Type hint "array" missing for $response
 289 | WARNING | [ ] Unused variable $field_name.
 292 | ERROR   | [ ] The array declaration extends to column 120 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
 293 | ERROR   | [x] Expected newline after closing brace
 294 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 295 | ERROR   | [x] Expected newline after closing brace
 296 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 304 | ERROR   | [ ] Missing parameter comment
 305 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 305 | ERROR   | [ ] If there is no return value for a function, there must not
     |         |     be a @return tag.
 305 | ERROR   | [ ] Description for the @return value is missing
 307 | ERROR   | [ ] Type hint "array" missing for $response
 314 | ERROR   | [ ] Parameter $order_total_amount is not described in comment
 328 | ERROR   | [ ] Description for the @return value is missing
 349 | WARNING | [x] '@TODO find out what to do here. German card didn't accept
     |         |     the exponent 2' should match the format '@todo Fix problem
     |         |     X here.'
 351 | WARNING | [ ] Line exceeds 80 characters; contains 223 characters
 353 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 0
 353 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
 354 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 0
 354 | ERROR   | [ ] Comment indentation error, expected only 4 spaces
 355 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 0
 358 | ERROR   | [ ] The array declaration extends to column 194 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
 388 | ERROR   | [x] Expected newline after closing brace
 409 | ERROR   | [x] Expected newline after closing brace
 674 | ERROR   | [ ] Description for the @return value is missing
 674 | ERROR   | [x] Data types in @return tags need to be fully namespaced
 674 | ERROR   | [x] Data types in @return tags need to be fully namespaced
 693 | ERROR   | [x] Expected 1 blank line after function; 0 found
 694 | ERROR   | [x] The closing brace for the class must have an empty line
     |         |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...10-site/web/modules/custom/commerce_valitor/src/ValitorPayApiInterface.php
--------------------------------------------------------------------------------
FOUND 29 ERRORS AND 1 WARNING AFFECTING 27 LINES
--------------------------------------------------------------------------------
   9 | ERROR   | [x] Doc comment short description must end with a full stop
  12 | WARNING | [ ] The class short comment should describe what the class
     |         |     does and not simply repeat the class name
  18 | ERROR   | [ ] Missing parameter comment
  18 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  27 | ERROR   | [ ] Missing parameter comment
  27 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  36 | ERROR   | [ ] Description for the @return value is missing
  43 | ERROR   | [ ] Missing parameter comment
  52 | ERROR   | [ ] Description for the @return value is missing
  59 | ERROR   | [ ] Missing parameter comment
  68 | ERROR   | [ ] Description for the @return value is missing
  70 | ERROR   | [ ] Public method name
     |         |     "ValitorPayApiInterface::getEnvironmentURL" is not in
     |         |     lowerCamel format
  75 | ERROR   | [ ] Description for the @return value is missing
  82 | ERROR   | [ ] Missing parameter comment
  91 | ERROR   | [ ] Description for the @return value is missing
  98 | ERROR   | [ ] Missing parameter comment
 107 | ERROR   | [ ] Missing parameter comment
 109 | ERROR   | [ ] Description for the @return value is missing
 111 | ERROR   | [ ] Type hint "array" missing for $payload
 116 | ERROR   | [ ] Missing parameter comment
 118 | ERROR   | [ ] Description for the @return value is missing
 120 | ERROR   | [ ] Type hint "array" missing for $payload
 125 | ERROR   | [ ] Missing parameter comment
 127 | ERROR   | [ ] Description for the @return value is missing
 129 | ERROR   | [ ] Type hint "array" missing for $payload
 134 | ERROR   | [ ] Missing parameter comment
 136 | ERROR   | [ ] Description for the @return value is missing
 138 | ERROR   | [ ] Type hint "array" missing for $payload
 138 | ERROR   | [x] Expected 1 blank line after function; 0 found
 139 | ERROR   | [x] The closing brace for the interface must have an empty
     |         |     line before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...l10-site/web/modules/custom/commerce_valitor/src/Controller/ValitorPay.php
--------------------------------------------------------------------------------
FOUND 24 ERRORS AND 4 WARNINGS AFFECTING 19 LINES
--------------------------------------------------------------------------------
   7 | WARNING | [x] Unused use statement
  16 | ERROR   | [x] Doc comment short description must end with a full stop
  17 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
  18 | WARNING | [ ] The class short comment should describe what the class
     |         |     does and not simply repeat the class name
  22 | ERROR   | [x] Doc comment short description must end with a full stop
  23 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
  23 | ERROR   | [x] Parameter comment must be on the next line
  24 | ERROR   | [x] Parameter comment must be on the next line
  24 | ERROR   | [x] Parameter comment must end with a full stop
  25 | ERROR   | [x] Separate the @param and @return sections by a blank line.
  25 | ERROR   | [ ] Description for the @return value is missing
  39 | ERROR   | [ ] Missing parameter comment
  39 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  40 | ERROR   | [x] Separate the @param and @return sections by a blank line.
  40 | ERROR   | [ ] Description for the @return value is missing
  70 | ERROR   | [x] Expected newline after closing brace
  89 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ]
  90 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ]
  97 | ERROR   | [ ] Missing parameter comment
  97 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  98 | ERROR   | [ ] Missing parameter comment
  98 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  99 | ERROR   | [x] Separate the @param and @return sections by a blank line.
  99 | ERROR   | [ ] Description for the @return value is missing
  99 | ERROR   | [x] Data types in @return tags need to be fully namespaced
 104 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 108 | ERROR   | [ ] The array declaration extends to column 123 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
 109 | ERROR   | [x] Expected newline after closing brace
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...10-site/web/modules/custom/commerce_valitor/src/Ajax/WindowOpenCommand.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 33 | ERROR | Doc comment short description must be on a single line, further
    |       | text should be a separate paragraph
 67 | ERROR | Description for the @return value is missing
 79 | ERROR | Type hint "array" missing for $window_options
--------------------------------------------------------------------------------

Time: 816ms; Memory: 14MB
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

leymannx Berlin

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

Comments & Activities

  • Issue created by @leymannx
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • leymannx Berlin

    I didn't change the method name as it maybe need to be deprecated first.

    After patch:

    FILE: ...my-drupal10-site/web/modules/custom/commerce_valitor/src/ValitorPayApi.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     179 | ERROR | Public method name "ValitorPayApi::getEnvironmentURL" is not in
         |       | lowerCamel format
    --------------------------------------------------------------------------------
    
    
    FILE: ...10-site/web/modules/custom/commerce_valitor/src/ValitorPayApiInterface.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     77 | ERROR | Public method name "ValitorPayApiInterface::getEnvironmentURL" is
        |       | not in lowerCamel format
    --------------------------------------------------------------------------------
    
    Time: 852ms; Memory: 14MB
    
  • leymannx Berlin

    This should get merged before anything else. Otherwise the work done would easily become a massive waste of time.

  • Status changed to RTBC almost 2 years ago
  • 🇵🇹Portugal jcnventura

    Otherwise the work done would easily become a massive waste of time.

    We don't want that.

    • leymannx authored 610660b5 on 2.x
      Issue #3337392 by leymannx, jcnventura: [2.x] Follow coding standards
      
  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024