Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/taxonomy_menu/src/Controller/TaxonomyMenu.php
------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------
25 | WARNING | Unused variable $links.
29 | WARNING | Unused variable $links.
------------------------------------------------------------------------

FILE: /app/modules/contrib/taxonomy_menu/src/Entity/TaxonomyMenu.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
148 | ERROR | [x] Use null coalesce operator instead of ternary operator.
199 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
259 | WARNING | [x] 'TODO:' should match the format '@todo Fix problem X here.'
262 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
277 | WARNING | [x] 'TODO: Consider implementing a forced weight based on taxonomy tree.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/taxonomy_menu/src/Form/TaxonomyMenuForm.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------
156 | WARNING | [ ] Menu::loadMultiple calls should be avoided in classes, use dependency injection instead
178 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/taxonomy_menu/src/Plugin/Derivative/TaxonomyMenuMenuLink.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------
48 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
53 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

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

FILE: /app/modules/contrib/taxonomy_menu/tests/src/Functional/TaxonomyMenuOperationsTest.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 8 WARNINGS AFFECTING 16 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
34 | ERROR | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
44 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
60 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
67 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
73 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
81 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
94 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
104 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
109 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
114 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
121 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
141 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
145 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
158 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
161 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
172 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

Time: 330ms; Memory: 10MB

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/taxonomy_menu/

Proposed resolution

Above error/warnings need to be fixed

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new11.74 KB

Issue fixed.

himanshu_jhaloya’s picture

Assigned: Unassigned » himanshu_jhaloya

I am reviewing the patch

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new100.48 KB
new42.21 KB

Reviewed the patch applied cleanly. looks good no error found

damienmckenna’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -, -
Parent issue: » #3233064: Plan for Taxonomy Menu 8.x-3.6
StatusFileSize
new2.74 KB
new11.24 KB

There's no need to translate strings in the tests.

damienmckenna’s picture

Title: Drupal Coding Standards Issues | phpcs » Drupal coding standards issues
Status: Needs review » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.