Fix coding standards

Created on 29 January 2023, over 1 year ago
Updated 7 February 2023, over 1 year ago

Problem/Motivation


phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml commerce_pei

FILE: /Users/admitriiev/Sites/1x/docker/drupal10/htdocs/web/modules/contrib/commerce_pei/tests/src/Unit/PeiApiUnitTest.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------------------------------
  55 | ERROR | [ ] Doc comment short description must start with a capital letter
  63 | ERROR | [ ] Doc comment short description must start with a capital letter
  72 | ERROR | [ ] Doc comment short description must start with a capital letter
  83 | ERROR | [ ] Doc comment short description must start with a capital letter
  94 | ERROR | [ ] Doc comment short description must start with a capital letter
  94 | ERROR | [x] Doc comment short description must end with a full stop
 105 | ERROR | [ ] Doc comment short description must start with a capital letter
 105 | ERROR | [x] Doc comment short description must end with a full stop
 116 | ERROR | [ ] Doc comment short description must start with a capital letter
 116 | ERROR | [x] Doc comment short description must end with a full stop
 127 | ERROR | [ ] Doc comment short description must start with a capital letter
 127 | ERROR | [x] Doc comment short description must end with a full stop
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------


FILE: /Users/admitriiev/Sites/1x/docker/drupal10/htdocs/web/modules/contrib/commerce_pei/README.md
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
 28 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------


FILE: .../admitriiev/Sites/1x/docker/drupal10/htdocs/web/modules/contrib/commerce_pei/src/PluginForm/PeiPaymentMethodAddForm.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 5 WARNINGS AFFECTING 17 LINES
-----------------------------------------------------------------------------------------------------------------------------
  29 | ERROR   | [ ] Class property $pei_service should use lowerCamel naming without underscores
  57 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
  59 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  91 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 114 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 120 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 126 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 209 | ERROR   | [ ] Missing parameter comment
 230 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
 257 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 276 | ERROR   | [x] Expected newline after closing brace
 286 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 290 | ERROR   | [x] Expected newline after closing brace
 298 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 328 | ERROR   | [x] Expected newline after closing brace
 334 | ERROR   | [x] Expected newline after closing brace
 358 | ERROR   | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over
     |         |     multiple lines
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------


FILE: /Users/admitriiev/Sites/1x/docker/drupal10/htdocs/web/modules/contrib/commerce_pei/src/PeiApi.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 37 ERRORS AND 3 WARNINGS AFFECTING 40 LINES
-----------------------------------------------------------------------------------------------------------------------------
  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
  27 | ERROR   | [x] Expected "\GuzzleHttp\Client" but found "\GuzzleHttp\Client;" for @var tag in member variable comment
 130 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 154 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 164 | ERROR   | [ ] Public method name "PeiApi::getEnvironmentURL" is not in lowerCamel format
 197 | ERROR   | [x] Parameter comment must end with a full stop
 226 | ERROR   | [x] Expected newline after closing brace
 227 | ERROR   | [ ] The array declaration extends to column 195 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 229 | ERROR   | [x] Expected newline after closing brace
 230 | ERROR   | [ ] The array declaration extends to column 240 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 251 | WARNING | [x] 'ToDo: There must be a better way.' should match the format '@todo Fix problem X here.'
 301 | ERROR   | [x] Expected newline after closing brace
 302 | ERROR   | [ ] The array declaration extends to column 195 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 304 | ERROR   | [x] Expected newline after closing brace
 305 | ERROR   | [ ] The array declaration extends to column 242 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 313 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 316 | ERROR   | [ ] Description for the @return value is missing
 340 | ERROR   | [ ] The array declaration extends to column 214 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 349 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 354 | ERROR   | [ ] Description for the @return value is missing
 379 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 382 | ERROR   | [x] Expected newline after closing brace
 385 | ERROR   | [x] Expected newline after closing brace
 389 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 390 | ERROR   | [ ] The array declaration extends to column 232 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 392 | ERROR   | [x] Expected newline after closing brace
 393 | ERROR   | [ ] The array declaration extends to column 241 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 401 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 406 | ERROR   | [ ] Description for the @return value is missing
 432 | ERROR   | [x] Expected newline after closing brace
 441 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 444 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 447 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 454 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
     |         |     parentheses
 456 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 457 | ERROR   | [ ] The array declaration extends to column 240 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 459 | ERROR   | [x] Expected newline after closing brace
 460 | ERROR   | [ ] The array declaration extends to column 249 (the limit is 80). The array content should be split up
     |         |     over multiple lines
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 25 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------


FILE: .../docker/drupal10/htdocs/web/modules/contrib/commerce_pei/src/Plugin/Commerce/PaymentGateway/OnsitePeiPaymentGateway.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 4 WARNINGS AFFECTING 19 LINES
-----------------------------------------------------------------------------------------------------------------------------
  34 | ERROR   | [ ] Missing short description in doc comment
  35 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  39 | ERROR   | [ ] Missing short description in doc comment
  40 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  61 | ERROR   | [ ] Missing parameter comment
  61 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  62 | ERROR   | [ ] Missing parameter comment
  62 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  92 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  93 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  94 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  95 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  96 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  97 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  98 | ERROR   | [x] Array closing indentation error, expected 4 spaces but found 6
 101 | ERROR   | [x] Missing function doc comment
 145 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 158 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 165 | ERROR   | [x] Missing function doc comment
 236 | WARNING | [x] There must be no blank line following an inline comment
 262 | WARNING | [x] 'TODO: Should we do something remotely?' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

Time: 138ms; Memory: 10MB

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany a.dmitriiev

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

Comments & Activities

Production build 0.69.0 2024