Fix the issues reported by phpcs

Created on 17 January 2024, 9 months ago
Updated 24 July 2024, 2 months ago

Problem/Motivation

FILE: /app/web/modules/contrib/asset_injector/tests/src/Functional/AssetInjectorJsTest.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
 14 | 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: /app/web/modules/contrib/asset_injector/tests/src/Functional/AssetInjectorCssTest.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
 14 | 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: /app/web/modules/contrib/asset_injector/src/AssetInjectorListBuilder.php
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
 108 | WARNING | Line exceeds 80 characters; contains 82 characters
------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/Form/AssetInjectorJsDuplicateForm.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: /app/web/modules/contrib/asset_injector/src/Form/AssetInjectorDisableForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
  5 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
 14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/Form/AssetInjectorFormBase.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
   6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityForm.
 219 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/Form/AssetInjectorDeleteForm.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
 5 | WARNING | [x] Unused use statement
 5 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/Form/AssetInjectorEnableForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
  5 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
 14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/Form/AssetInjectorJsForm.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
  11 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 106 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/Entity/AssetInjectorBase.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\asset_injector\AssetFileStorage.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/src/AssetInjectorAccessControlHandler.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
 164 | WARNING | Line exceeds 80 characters; contains 108 characters
---------------------------------------------------------------------------------------


FILE: /app/web/modules/contrib/asset_injector/asset_injector.module
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Asset\AttachedAssetsInterface.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig asset_injector/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India Pinesh Kumar

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024