[8.x-1.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: ...e/web/modules/custom/commerce_valitor/src/PluginForm/PaymentRefundForm.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 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
 26 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 44 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 50 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
 66 | ERROR   | [x] Expected newline after closing brace
 67 | 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 2 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: ...es/my-drupal10-site/web/modules/custom/commerce_valitor/src/ValitorApi.php
--------------------------------------------------------------------------------
FOUND 24 ERRORS AND 24 WARNINGS AFFECTING 39 LINES
--------------------------------------------------------------------------------
  88 | ERROR   | [ ] Missing @var tag in member variable comment
  93 | ERROR   | [ ] Missing @var tag in member variable comment
  98 | ERROR   | [ ] Missing @var tag in member variable comment
 103 | ERROR   | [ ] Missing @var tag in member variable comment
 108 | ERROR   | [ ] Missing @var tag in member variable comment
 113 | ERROR   | [ ] Missing @var tag in member variable comment
 123 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 125 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 126 | ERROR   | [x] Parameter comment indentation must be 3 spaces, found 2
     |         |     spaces
 127 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 355 | ERROR   | [ ] Public method name "ValitorApi::getSSNumberLength" is not
     |         |     in lowerCamel format
 378 | WARNING | [ ] Exceptions should not be translated
 381 | WARNING | [ ] Exceptions should not be translated
 392 | WARNING | [ ] Exceptions should not be translated
 395 | WARNING | [ ] Exceptions should not be translated
 406 | WARNING | [ ] Exceptions should not be translated
 417 | WARNING | [ ] Exceptions should not be translated
 420 | WARNING | [ ] Exceptions should not be translated
 423 | WARNING | [ ] Exceptions should not be translated
 426 | WARNING | [x] '@todo: Add SSN validation.' should match the format
     |         |     '@todo Fix problem X here.'
 426 | WARNING | [x] There must be no blank line following an inline comment
 426 | WARNING | [ ] There must be no blank line following an inline comment
 436 | WARNING | [ ] Exceptions should not be translated
 439 | WARNING | [ ] Exceptions should not be translated
 478 | WARNING | [ ] Exceptions should not be translated
 478 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
 509 | ERROR   | [ ] Public method name "ValitorApi::getContractSSNumber" is
     |         |     not in lowerCamel format
 516 | ERROR   | [ ] Public method name "ValitorApi::setContractSSNumber" is
     |         |     not in lowerCamel format
 534 | WARNING | [ ] Exceptions should not be translated
 534 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
 543 | ERROR   | [ ] Public method name "ValitorApi::getEnvironmentURL" is not
     |         |     in lowerCamel format
 642 | WARNING | [ ] Exceptions should not be translated
 642 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
 656 | ERROR   | [x] Doc comment star missing
 668 | ERROR   | [ ] Type hint "array" missing for $params
 684 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
     |         |     but found "true"
 686 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE"
     |         |     but found "false"
 687 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE"
     |         |     but found "false"
 691 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
     |         |     question marks, colons, or closing parentheses
 694 | WARNING | [ ] Exceptions should not be translated
 694 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
 698 | WARNING | [ ] Exceptions should not be translated
 698 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
 703 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
     |         |     but found "true"
 710 | ERROR   | [x] Expected newline after closing brace
 710 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 716 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         |     $this->t() instead
 716 | ERROR   | [x] Space found before comma in argument list
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...custom/commerce_valitor/src/Plugin/Commerce/PaymentGateway/ValitorMock.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 10 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
  7 | WARNING | [x] Unused use statement
  9 | WARNING | [x] Unused use statement
 10 | WARNING | [x] Unused use statement
 11 | WARNING | [x] Unused use statement
 12 | WARNING | [x] Unused use statement
 13 | WARNING | [x] Unused use statement
 14 | WARNING | [x] Unused use statement
 42 | ERROR   | [x] Expected 1 blank line before function; 0 found
 59 | WARNING | [ ] Exceptions should not be translated
 59 | WARNING | [ ] Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...les/custom/commerce_valitor/src/Plugin/Commerce/PaymentGateway/Valitor.php
--------------------------------------------------------------------------------
FOUND 33 ERRORS AND 15 WARNINGS AFFECTING 36 LINES
--------------------------------------------------------------------------------
  18 | WARNING | [x] Unused use statement
  49 | ERROR   | [ ] Missing short description in doc comment
  50 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  54 | ERROR   | [x] The open comment tag must be the only content on the line
  54 | ERROR   | [ ] Missing short description in doc comment
  54 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  54 | ERROR   | [x] Expected "MessengerInterface" but found
     |         |     "MessengerInterface " for @var tag in member variable
     |         |     comment
  60 | ERROR   | [ ] Missing parameter comment
  61 | ERROR   | [ ] Missing parameter comment
  61 | ERROR   | [ ] Missing parameter type
  62 | ERROR   | [ ] Missing parameter comment
  62 | ERROR   | [ ] Missing parameter type
  63 | ERROR   | [ ] Missing parameter comment
  63 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  64 | ERROR   | [ ] Missing parameter comment
  64 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  65 | ERROR   | [ ] Missing parameter comment
  65 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  66 | ERROR   | [ ] Missing parameter comment
  66 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  67 | ERROR   | [ ] Missing parameter comment
  67 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  68 | ERROR   | [ ] Missing parameter comment
  68 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 175 | WARNING | [ ] Empty return statement not required here
 193 | WARNING | [ ] Empty return statement not required here
 211 | WARNING | [ ] Empty return statement not required here
 229 | WARNING | [ ] Empty return statement not required here
 247 | WARNING | [ ] Empty return statement not required here
 270 | ERROR   | [x] There must be exactly one blank line before the tags in a
     |         |     doc comment
 270 | ERROR   | [ ] The @see reference should not contain any additional text
 272 | ERROR   | [ ] Parameter tags must be defined first in a doc comment
 283 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: 999
 288 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: 231
 304 | ERROR   | [ ] The array declaration extends to column 110 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
 308 | ERROR   | [x] Expected newline after closing brace
 309 | ERROR   | [ ] The array declaration extends to column 108 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
 313 | ERROR   | [x] Expected newline after closing brace
 315 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 340 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 366 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 390 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 417 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 458 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 483 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 493 | ERROR   | [ ] Description for the @return value is missing
 512 | ERROR   | [x] Expected 1 blank line after function; 0 found
 513 | ERROR   | [x] The closing brace for the class must have an empty line
     |         |     before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...pal10-site/web/modules/custom/commerce_valitor/src/ValitorApiInterface.php
--------------------------------------------------------------------------------
FOUND 39 ERRORS AND 1 WARNING AFFECTING 40 LINES
--------------------------------------------------------------------------------
  13 | ERROR   | [x] Expected "int" but found "integer" for function return
     |         |     type
  29 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
  31 | ERROR   | [x] Expected "int" but found "integer" for parameter type
  42 | ERROR   | [x] Expected "int" but found "integer" for function return
     |         |     type
  45 | ERROR   | [ ] Public method name
     |         |     "ValitorApiInterface::getSSNumberLength" is not in
     |         |     lowerCamel format
  50 | ERROR   | [x] Expected "int" but found "integer" for function return
     |         |     type
  58 | ERROR   | [x] Expected "int" but found "integer" for function return
     |         |     type
  63 | ERROR   | [ ] Missing short description in doc comment
  64 | ERROR   | [x] Expected "int" but found "integer" for parameter type
  67 | ERROR   | [x] Expected "bool" but found "boolean" for function return
     |         |     type
  74 | ERROR   | [ ] Missing short description in doc comment
  78 | ERROR   | [x] Expected "bool" but found "boolean" for function return
     |         |     type
  85 | ERROR   | [ ] Missing short description in doc comment
  86 | ERROR   | [x] Expected "int" but found "integer" for parameter type
  89 | ERROR   | [x] Expected "bool" but found "boolean" for function return
     |         |     type
  96 | ERROR   | [ ] Missing short description in doc comment
  97 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 100 | ERROR   | [x] Expected "bool" but found "boolean" for function return
     |         |     type
 107 | ERROR   | [ ] Missing short description in doc comment
 111 | ERROR   | [x] Expected "bool" but found "boolean" for function return
     |         |     type
 121 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 125 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 178 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 180 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 182 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 196 | ERROR   | [ ] Doc comment short description must be on a single line,
     |         |     further text should be a separate paragraph
 200 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 261 | ERROR   | [x] Expected "int" but found "integer" for function return
     |         |     type
 269 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 281 | ERROR   | [x] Expected "int" but found "integer" for function return
     |         |     type
 284 | ERROR   | [ ] Public method name
     |         |     "ValitorApiInterface::getContractSSNumber" is not in
     |         |     lowerCamel format
 289 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 296 | ERROR   | [ ] Public method name
     |         |     "ValitorApiInterface::setContractSSNumber" is not in
     |         |     lowerCamel format
 324 | ERROR   | [ ] Public method name
     |         |     "ValitorApiInterface::getEnvironmentURL" is not in
     |         |     lowerCamel format
 357 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 388 | ERROR   | [ ] Doc comment short description must be on a single line,
     |         |     further text should be a separate paragraph
 390 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 392 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 405 | ERROR   | [ ] Doc comment short description must be on a single line,
     |         |     further text should be a separate paragraph
 409 | ERROR   | [x] Expected "int" but found "integer" for parameter type
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 27 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 627ms; Memory: 12MB
🐛 Bug report
Status

Fixed

Version

1.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 method names (I guess they should be deprecated first) and didn't fix the SSL peer verification warning.

    After patch:

    FILE: ...es/my-drupal10-site/web/modules/custom/commerce_valitor/src/ValitorApi.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
    --------------------------------------------------------------------------------
     370 | ERROR   | Public method name "ValitorApi::getSSNumberLength" is not in
         |         | lowerCamel format
     523 | ERROR   | Public method name "ValitorApi::getContractSSNumber" is not in
         |         | lowerCamel format
     530 | ERROR   | Public method name "ValitorApi::setContractSSNumber" is not in
         |         | lowerCamel format
     557 | ERROR   | Public method name "ValitorApi::getEnvironmentURL" is not in
         |         | lowerCamel format
     702 | WARNING | Potential security problem: SSL peer verification must not be
         |         | disabled
    --------------------------------------------------------------------------------
    
    
    FILE: ...pal10-site/web/modules/custom/commerce_valitor/src/ValitorApiInterface.php
    --------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
      45 | ERROR | Public method name "ValitorApiInterface::getSSNumberLength" is
         |       | not in lowerCamel format
     293 | ERROR | Public method name "ValitorApiInterface::getContractSSNumber" is
         |       | not in lowerCamel format
     305 | ERROR | Public method name "ValitorApiInterface::setContractSSNumber" is
         |       | not in lowerCamel format
     333 | ERROR | Public method name "ValitorApiInterface::getEnvironmentURL" is
         |       | not in lowerCamel format
    --------------------------------------------------------------------------------
    
    Time: 613ms; Memory: 12MB
    
  • 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 (again).

    • leymannx authored 7124a3f7 on 8.x-1.x
      Issue #3337367 by leymannx, jcnventura: [8.x-1.x] Follow coding...
  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024