Fix the issues reported by phpcs

Created on 8 December 2022, over 1 year ago
Updated 3 June 2024, 21 days ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/key/drush/key_delete.drush.inc
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
20 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/drush/key_list.drush.inc
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
16 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/drush/key_value_get.drush.inc
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
11 | WARNING | [x] 'TODO: Only return the value (without the index), so the label can be' should match the format '@todo Fix problem X here.'
21 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Commands/KeyCommands.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
17 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
194 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
234 | ERROR | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
237 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
344 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Controller/KeyConfigOverrideListBuilder.php
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
84 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Controller/KeyListBuilder.php
-------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------
78 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
98 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
157 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Entity/Key.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------
341 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
363 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Entity/KeyConfigOverride.php
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
142 | WARNING | [x] 'TODO: Get the key entity.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyAddForm.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/modules/contrib/key/src/Form/KeyConfigOverrideAddForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
18 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
300 | ERROR | The array declaration extends to column 111 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyEditForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
29 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Form/KeyFormBase.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------
86 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
355 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
358 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
382 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
385 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
412 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
415 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/KeyConfigOverrideInterface.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: /app/modules/contrib/key/src/KeyConfigOverrides.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------
54 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
55 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
73 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
144 | WARNING | Unused variable $id.
----------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/src/Plugin/KeyProvider/ConfigKeyProvider.php
---------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------
48 | ERROR | [x] Use null coalesce operator instead of ternary operator.
72 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/modules/key_test/src/Plugin/KeyProvider/State.php
----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------
13 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Functional/KeyInputTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Functional/KeyOverrideAdminTest.php
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
16 | ERROR | Missing member variable doc comment
----------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Functional/KeyRepositoryServiceTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
64 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/key/tests/src/Unit/Entity/KeyEntityTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------
44 | ERROR | Class property $key_type_settings should use lowerCamel naming without underscores
52 | ERROR | Class property $key_provider_settings should use lowerCamel naming without underscores
60 | ERROR | Class property $key_input_settings should use lowerCamel naming without underscores
111 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

Time: 977ms; Memory: 14MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/key/

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024