Problem/Motivation
Getting the following errors.
FILE: /app/web/modules/contrib/currency_fixer_io/src/Plugin/Currency/ExchangeRateProvider/FixerIoOperationsProvider.php
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------
FILE: /app/web/modules/contrib/currency_fixer_io/src/Service/FixerIo.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Logger\LoggerChannelFactoryInterface.
81 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
98 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/web/modules/contrib/currency_fixer_io/src/Form/CurrencyFixerIoSettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------
Time: 136ms; Memory: 12MB
after phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css web/modules/contrib/currency_fixer_io
FILE: /app/web/modules/contrib/currency_fixer_io/src/Service/FixerIo.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------
81 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
98 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------
Time: 137ms; Memory: 12MB
Steps to reproduce
Run the following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/currency_fixer_io/
Proposed resolution
Above errors need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot from 2024-07-09 16-23-22.png | 26.55 KB | bhaveshdas |
Issue fork currency_fixer_io-3460127
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nilesh.addweb commentedComment #4
nilesh.addweb commentedHi,
I have fixed phpcs issues and Created MR. Please review it.
Comment #5
bhaveshdas commentedI have tested MR!4 and it is working properly with no errors found. I will move it forward to RTBC.