Resolve multiple issues with Drupal code standard

Created on 23 August 2023, about 1 year ago
Updated 25 August 2023, about 1 year ago

Problem/Motivation

FILE: /home/prauat/commerce_currency_resolver/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
78 | WARNING | Line exceeds 80 characters; contains 110 characters
80 | WARNING | Line exceeds 80 characters; contains 81 characters
100 | WARNING | Line exceeds 80 characters; contains 91 characters
114 | WARNING | Line exceeds 80 characters; contains 112 characters
115 | WARNING | Line exceeds 80 characters; contains 108 characters
----------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/CurrencyHelper.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
81 | ERROR | Missing parameter comment
----------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Cache/Context/CurrencyCacheContext.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Cache\CacheableMetadata.
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/EventSubscriber/CurrencyOrderRefresh.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\commerce_currency_resolver\CurrentCurrency.
11 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Block/CommerceCurrencyResolverSelectBlock.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\commerce_currency_resolver\Form\CommerceCurrencyResolverSelectForm.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Commerce/Condition/OrderTotalPrice.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\commerce_price\Price.
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Commerce/CommerceCurrencyResolverAmountTrait.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\commerce_price\Price.
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Commerce/PromotionOffer/OrderItemFixedAmountOff.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\commerce_order\Adjustment.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Commerce/PromotionOffer/OrderFixedAmountOff.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\commerce_order\Adjustment.
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Commerce/Fee/OrderItemFixedAmount.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\commerce_fee\Entity\FeeInterface.
11 | ERROR | [x] Missing class doc comment
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Plugin/Commerce/Fee/OrderFixedAmount.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\commerce_fee\Entity\FeeInterface.
11 | ERROR | [x] Missing class doc comment
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Form/CommerceCurrencyResolverForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
42 | ERROR | [x] Space before opening parenthesis of function call prohibited
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Form/CommerceCurrencyResolverMapping.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\Core\Config\ConfigFactoryInterface.
16 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
191 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Form/CommerceCurrencyResolverSelectForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/CurrencyHelperInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Controller/CommerceCurrencyResolverAutocomplete.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Symfony\Component\HttpFoundation\JsonResponse.
16 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/PriceExchangerCalculator.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/Resolver/CommerceCurrencyResolver.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\commerce_currency_resolver\CurrentCurrencyInterface.
123 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/src/CurrentCurrency.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | CommerceGuys\Addressing\Country\CountryRepository.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/commerce_currency_resolver.module
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityInterface.
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/Traits/CurrentCurrencyTrait.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/Functional/CurrentCurrencyCartTest.php
----------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------
53 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
54 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
55 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
56 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
57 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
64 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/Kernel/CurrentCurrencyTest.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\commerce_store\Entity\Store.
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/Kernel/OrderProcessorTest.php
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
51 | ERROR | Missing short description in doc comment
-------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/Kernel/TestProcessorOverridden.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/Kernel/OrderIntegrationTest.php
---------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------
70 | ERROR | [x] Array closing indentation error, expected 6 spaces but found 8
71 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/tests/src/FunctionalJavascript/CurrentCurrencyOrderAdminTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------------------------------------
15 | ERROR | [ ] Missing short description in doc comment
45 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
46 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
47 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
48 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
49 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
56 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------

FILE: ...mmerce_currency_resolver/tests/modules/commerce_currency_resolver_test/src/CommerceCurrencyResolverTestServiceProvider.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
17 | ERROR | [x] Equals sign not aligned correctly; expected 1 space but found 2 spaces
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/modules/shipping/src/EventSubscriber/CommerceShippingCurrency.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\commerce_currency_resolver\CurrentCurrency.
64 | ERROR | [x] Expected newline after closing brace
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/modules/shipping/tests/src/FunctionalJavascript/ShippingAdminIntegrationTest.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------------
15 | ERROR | [ ] Missing short description in doc comment
45 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
46 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
47 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
48 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
49 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
56 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
90 | ERROR | [x] Expected 1 blank line after function; 2 found
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: /home/prauat/commerce_currency_resolver/modules/shipping/tests/src/FunctionalJavascript/ShippingIntegrationTest.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
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
79 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇵🇱Poland prauat Wroclaw

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

Comments & Activities

  • Issue created by @prauat
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • 🇵🇱Poland prauat Wroclaw

    Patch fixing everything except README.md code example

  • Status changed to Closed: won't fix about 1 year ago
  • 🇭🇷Croatia valic Osijek

    Sorry, but I am not committing a patch of 26kb in the name of coding standards. don't have time to review this.

    coding standards can be resolved withing other issues

Production build 0.71.5 2024