Fix the issues reported by phpcs

Created on 10 July 2024, 10 months ago

Problem/Motivation
FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Plugin/ResourceBase.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
  14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Messenger\MessengerInterface.
 191 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 192 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 193 | ERROR | [ ] The array declaration extends to column 150 (the limit is 120). The array content should be split up over multiple lines
 193 | ERROR | [ ] The array declaration extends to column 149 (the limit is 120). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Plugin/ResourceManager.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Cache\CacheBackendInterface.
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Plugin/Derivative/ResourceMenuLink.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
 54 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Plugin/Menu/ResourceMenuLink.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/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/EmployeesForm.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------
  92 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 191 | WARNING | [ ] Variable $values inside unset call is undefined.
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/ProjectForm.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
 67 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/ResourceFormBase.php
----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------
  14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
  83 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 117 | WARNING | [ ] Variable $values inside unset call is undefined.
 120 | WARNING | [ ] Variable $values inside unset call is undefined.
 123 | WARNING | [ ] Variable $values inside unset call is undefined.
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/AbsenceTransactionsForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
 60 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/SupplierInvoicesForm.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
 88 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/AccountsForm.php
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
 66 | ERROR | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/SuppliersForm.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------
  12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
  97 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
  98 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 167 | WARNING | [ ] Variable $values inside unset call is undefined.
 174 | WARNING | [ ] Variable $values inside unset call is undefined.
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Form/ContractsForm.php
-----------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------
  94 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 110 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Controller/CreateResourcePage.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/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/src/Element/AddMoreAjax.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
 63 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/fortnox_credentials.routing.yml
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/Entity/Credentials.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityBase.
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/Form/CredentialsForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 62 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/Form/CredentialsSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------
 12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/Form/CredentialsDeleteForm.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------
 10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/Controller/UserLocalTask.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------
 12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/CredentialsAccessControlHandler.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: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/modules/fortnox_credentials/src/CredentialsListBuilder.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
 29 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/fortnox.routing.yml
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 53 | WARNING | The administration page callback should probably use "administer site configuration" - which implies the user can change something - rather than "access administration pages" which is about
    |         | viewing but not changing configurations.
 60 | WARNING | The administration page callback should probably use "administer site configuration" - which implies the user can change something - rather than "access administration pages" which is about
    |         | viewing but not changing configurations.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/addweb/Drupal8-vagrant/web/web/drupal8_9/web/modules/contrib/fortnox/fortnox.module
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 31 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

Steps to reproduce

Running :-
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig fortnox/
returns the above listed warnings/errors, which should be fixed.

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

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