Problem/Motivation
Coding standards issue found by phpcs.
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/multi_region/src/Form/ConfigurableRegionForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/multi_region/src/Plugin/Block/RegionLanguageSwitcherBlock.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Access\AccessResult.
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/multi_region/src/ConfigurableRegionHtmlRouteProvider.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
19 | WARNING | Possible useless method overriding detected
---------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/multi_region/src/ConfigurableRegionAccessControlHandler.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Access\AccessResult.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/multi_region/src/ConfigurableRegionListBuilder.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/multi_region/src/RegionManager.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
129 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 10
139 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------
Steps to reproduce
Use the below command with arguments:-
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/multi_region
Proposed resolution
Fix the phpcs issue found.