Problem/Motivation
There are loads of Drupal CS issues in this module, which need fixing.
Steps to reproduce
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .
Proposed resolution
Fix the following CS fixes:
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/src/Form/GeshiFilterSettingsForm.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
-----------------------------------------------------------------------------------------------
56 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
57 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
92 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
136 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
153 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
162 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
196 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
197 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
198 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
237 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
298 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
303 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
331 | WARNING | #options values usually have to run through t() for translation
332 | WARNING | #options values usually have to run through t() for translation
374 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/src/GeshiFilter.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------
173 | WARNING | Unused variable $filename.
182 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/src/Plugin/Filter/GeshiFilterFilter.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 9 WARNINGS AFFECTING 12 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
85 | ERROR | [x] list(...) is forbidden, use [...] instead.
107 | ERROR | [ ] The array declaration extends to column 112 (the limit is 80). The array content should be split up over multiple lines
133 | ERROR | [x] list(...) is forbidden, use [...] instead.
133 | WARNING | [ ] Unused variable $tag_to_lang.
146 | WARNING | [x] '@todo: make sure that these replacements can be done in series.' should match the format '@todo Fix problem X here.'
227 | ERROR | [x] list(...) is forbidden, use [...] instead.
272 | ERROR | [ ] The array declaration extends to column 126 (the limit is 80). The array content should be split up over multiple lines
368 | ERROR | [x] list(...) is forbidden, use [...] instead.
501 | WARNING | [x] '@todo: recreate a cache for this function.' should match the format '@todo Fix problem X here.'
716 | ERROR | [x] list(...) is forbidden, use [...] instead.
716 | WARNING | [ ] Unused variable $generic_code_tags.
778 | ERROR | [x] list(...) is forbidden, use [...] instead.
778 | WARNING | [ ] Unused variable $generic_code_tags.
910 | ERROR | [x] list(...) is forbidden, use [...] instead.
910 | WARNING | [ ] Unused variable $generic_code_tags.
910 | WARNING | [ ] Unused variable $language_tags.
982 | ERROR | [x] list(...) is forbidden, use [...] instead.
982 | WARNING | [ ] Unused variable $generic_code_tags.
982 | WARNING | [ ] Unused variable $language_tags.
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/tests/src/Functional/GeshiFilterAdministrationTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------------------------------
107 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
108 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
116 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
169 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
170 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
182 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/tests/src/Functional/GeshiFilterCssTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------
121 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
155 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
188 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
216 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
217 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/tests/src/Functional/GeshiFilterTest.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 44 WARNINGS AFFECTING 45 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
136 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
137 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
177 | ERROR | [x] list(...) is forbidden, use [...] instead.
208 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
211 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
214 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
221 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
227 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
230 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
233 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
236 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
239 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
258 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
262 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
265 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
268 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
286 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
290 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
293 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
296 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
315 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
319 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
322 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
325 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
344 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
348 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
351 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
354 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
373 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
377 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
380 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
383 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
403 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
406 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
426 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
429 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
448 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
452 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
456 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
468 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
481 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
493 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
506 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
525 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
528 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/config/install/geshifilter.settings.yml
--------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
39 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
47 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
50 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/codesnippetgeshi/src/Controller/GeshiController.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: /var/www/html/web/modules/custom/geshifilter-3297301/codesnippetgeshi/src/Plugin/CKEditorPlugin/CodeSnippetGeshiCKEditorButton.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
25 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/codesnippetgeshi/codesnippetgeshi.info.yml
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
-----------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/codesnippetgeshi/README.txt
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------
46 | WARNING | Line exceeds 80 characters; contains 84 characters
--------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshi-extra/drupal5.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
22 | WARNING | Unused variable $language_data.
----------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshi-extra/drupal6.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
21 | WARNING | Unused variable $language_data.
----------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshifield/src/Plugin/Field/FieldWidget/GeshiFieldDefaultWidget.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------
32 | ERROR | [x] Use null coalesce operator instead of ternary operator.
37 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshifield/src/Plugin/Field/FieldFormatter/GeshiFieldDefaultFormatter.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
32 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshifield/tests/src/Functional/GeshiFieldTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshifield/geshifield.info.yml
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/custom/geshifilter-3297301/geshifield/geshifield.module
---------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] '@todo: is the GeSHi CSS file always loaded when needed?' should match the format '@todo Fix problem X here.'
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------
Remaining tasks
User interface changes
API changes
Data model changes