Fix phpcs reported issues

Created on 9 November 2023, 11 months ago

Problem/Motivation

FILE: /var/www/docroot/modules/custom/similarterms/similarterms.views.inc
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [ ] Function similarterms_views_data_alter() does not have parameter type hint nor @param annotation for its parameter $data.
11 | ERROR | [x] Function similarterms_views_data_alter() does not have void return type hint.
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/docroot/modules/custom/similarterms/similarterms.module
----------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
13 | ERROR | Function similarterms_help() does not have parameter type hint nor @param annotation for its parameter $route_name.
13 | ERROR | Function similarterms_help() does not have return type hint nor @return annotation for its return value.
----------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/docroot/modules/custom/similarterms/src/Plugin/views/sort/SimilarTermsSort.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
19 | ERROR | [ ] Method \Drupal\similarterms\Plugin\views\sort\SimilarTermsSort::defineOptions() does not have return type hint nor @return annotation for its return value.
28 | ERROR | [x] Method \Drupal\similarterms\Plugin\views\sort\SimilarTermsSort::query() does not have void return type hint.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/docroot/modules/custom/similarterms/src/Plugin/views/argument/SimilarTermsArgument.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\taxonomy\VocabularyStorageInterface.
26 | ERROR | [x] Property \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::$connection does not have native type hint for its value but it should be possible to add it based on @var annotation
| | "\Drupal\Core\Database\Connection".
33 | ERROR | [x] Property \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::$vocabularyStorage does not have native type hint for its value but it should be possible to add it based on @var annotation
| | "\Drupal\taxonomy\VocabularyStorageInterface".
38 | ERROR | [ ] @var annotation of property \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::$tids does not specify type hint for its items.
45 | ERROR | [ ] @param annotation of method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::__construct() does not specify type hint for items of its traversable parameter $configuration.
56 | ERROR | [x] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::__construct() does not have native type hint for its parameter $plugin_id but it should be possible to add it based on @param
| | annotation "string".
56 | ERROR | [x] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::__construct() does not have native type hint for its parameter $plugin_definition but it should be possible to add it based on
| | @param annotation "mixed".
74 | ERROR | [ ] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::defineOptions() does not have return type hint nor @return annotation for its return value.
85 | ERROR | [ ] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::buildOptionsForm() does not have parameter type hint nor @param annotation for its parameter $form.
85 | ERROR | [x] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::buildOptionsForm() does not have void return type hint.
116 | ERROR | [ ] The array declaration extends to column 117 (the limit is 80). The array content should be split up over multiple lines
123 | ERROR | [ ] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::validateArgument() does not have parameter type hint nor @param annotation for its parameter $arg.
123 | ERROR | [ ] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::validateArgument() does not have return type hint nor @return annotation for its return value.
162 | ERROR | [ ] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::query() does not have parameter type hint nor @param annotation for its parameter $group_by.
162 | ERROR | [x] Method \Drupal\similarterms\Plugin\views\argument\SimilarTermsArgument::query() does not have void return type hint.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shelane

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

Comments & Activities

Production build 0.71.5 2024