Problem/Motivation
Resolved issues reported by Drupal coding standards.
Steps to reproduce
1. Run PHP coding standard to regenerate the report
the report is generated using following command
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml private_taxonomy
FILE: private_taxonomy/private_taxonomy.tokens.inc
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
37 | WARNING | Unused variable $token_service.
-------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/src/Form/PrivateTaxonomySettingsForm.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Database\Connection.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/src/Plugin/Field/FieldFormatter/PrivateTaxonomyFormatterBase.php
--------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldDefinitionInterface.
75 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
77 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
80 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
--------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/src/Plugin/Field/FieldType/PrivateTaxonomyTermReferenceItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------
75 | ERROR | The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/src/Plugin/Field/FieldWidget/PrivateTaxonomyAutocompleteWidget.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\taxonomy\Entity\Term.
110 | ERROR | [x] Use null coalesce operator instead of ternary operator.
148 | WARNING | [ ] Unused variable $result.
----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/src/Controller/TermAutocompleteController.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 6 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\HttpFoundation\JsonResponse.
87 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
134 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
163 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
178 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
179 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
206 | WARNING | [ ] Unused variable $tid.
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/private_taxonomy.module
--------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 3 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityInterface.
82 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
86 | ERROR | [x] Expected 1 space before "="; 0 found
89 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
112 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
217 | ERROR | [x] Separate the @param and @return sections by a blank line.
233 | ERROR | [x] list(...) is forbidden, use [...] instead.
233 | WARNING | [ ] Unused variable $table.
306 | WARNING | [ ] Unused variable $result.
352 | ERROR | [x] Expected "arrayint" but found "array/int" for parameter type
389 | ERROR | [x] Expected "arrayint" but found "array/int" for parameter type
862 | WARNING | [ ] Unused variable $result.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/tests/src/Functional/PrivateTaxonomyTestBase.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\taxonomy\Entity\Vocabulary.
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/tests/src/Functional/PrivateTaxonomySettingsTest.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
97 | WARNING | Unused variable $user.
--------------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/tests/src/Functional/PrivateTaxonomyViewsTest.php
----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------
19 | ERROR | Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations.
115 | WARNING | Unused variable $private_vocabulary.
----------------------------------------------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/tests/src/Functional/PrivateTaxonomyPermissionsTest.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
184 | WARNING | Unused variable $public_vocabulary.
289 | WARNING | Unused variable $admin_user.
439 | WARNING | Unused variable $user.
-----------------------------------------------------------------------------------------------------------------------------------------------
Time: 315ms; Memory: 18MB
Proposed resolution
Remaining tasks
FILE: private_taxonomy/private_taxonomy.module
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
234 | WARNING | Unused variable $table.
---------------------------------------------------------------------------------------------------------------
FILE: private_taxonomy/tests/src/Functional/PrivateTaxonomyViewsTest.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------
19 | ERROR | Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations.
-------------------------------------------------------------------------------------------------------------------------------------------------
Time: 315ms; Memory: 18MB
User interface changes
API changes
Data model changes