Fix the issues reported by phpcs

Created on 27 April 2023, about 1 year ago

1. Rename README.txt -> README.md

2. It seems you have missed working on the coding standards. You can use the PHPCS tool for checking and resolving issues.

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

FILE: /var/www/html/solr_search_synonym/solr_search_synonym.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/console/translations/en/solrsearch.synonym.export.yml
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
22 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/SynonymViewsData.php
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
156 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
-------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Command/SynonymDrushCommands.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
15 | ERROR | Missing short description in doc comment
23 | ERROR | Missing parameter comment
46 | ERROR | The array declaration extends to column 140 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Form/SynonymSettingsForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 6 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
17 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
84 | ERROR | [ ] The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
84 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
85 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
91 | ERROR | [x] Use null coalesce operator instead of ternary operator.
154 | WARNING | [ ] Line exceeds 80 characters; contains 117 characters
155 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
164 | WARNING | [ ] Possible useless method overriding detected
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Form/SynonymImportForm.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------
20 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
95 | WARNING | Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
132 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
227 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Plugin/solr_search_synonym/export/Solr.php
--------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
45 | ERROR | Parameter tags must be grouped together in a doc comment
48 | ERROR | Parameter tags must be grouped together in a doc comment
--------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Plugin/solr_search_synonym/export/SolrUploader.php
----------------------------------------------------------------------------------------------
FOUND 15 ERRORS AND 3 WARNINGS AFFECTING 18 LINES
----------------------------------------------------------------------------------------------
22 | ERROR | Missing parameter comment
23 | ERROR | Missing parameter comment
25 | ERROR | Description for the @return value is missing
41 | ERROR | Missing parameter comment
43 | ERROR | Description for the @return value is missing
62 | ERROR | Missing parameter comment
64 | ERROR | Description for the @return value is missing
74 | ERROR | sizeof() is a function name alias, use count() instead
84 | ERROR | Missing parameter comment
86 | ERROR | Description for the @return value is missing
100 | ERROR | Missing parameter comment
102 | ERROR | Type hint "array" missing for $lines
128 | WARNING | Unused variable $output.
136 | WARNING | Unused variable $key.
149 | ERROR | Parameter tags must be grouped together in a doc comment
152 | ERROR | Parameter tags must be grouped together in a doc comment
179 | ERROR | Missing parameter comment
189 | WARNING | Unused variable $output.
----------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Plugin/solr_search_synonym/import/CSV.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------------------------
61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
65 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
78 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
100 | WARNING | Unused variable $values.
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Plugin/solr_search_synonym/import/JSON.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Plugin/solr_search_synonym/import/Solr.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Export/ExportPluginManager.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
98 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Export/ExportPluginInterface.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
18 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Export/ExportPluginBase.php
-----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------
74 | WARNING | Unused variable $values.
80 | WARNING | Possible useless method overriding detected
-----------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/SynonymListBuilder.php
------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------
114 | ERROR | Parameter tags must be grouped together in a doc comment
120 | ERROR | Type hint "\Drupal\solr_search_synonym\Entity\Synonym" missing for $entity
------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Controller/SolrSynonymUploaderBatchExport.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 10 WARNINGS AFFECTING 18 LINES
------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | Namespaced classes, interfaces and traits should not begin with a file doc comment
13 | ERROR | Doc comment is empty
18 | ERROR | Doc comment is empty
22 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
23 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
26 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
36 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
39 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
48 | ERROR | The array declaration extends to column 127 (the limit is 80). The array content should be split up over multiple lines
53 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
59 | ERROR | Doc comment is empty
62 | ERROR | Public method name "SolrSynonymUploaderBatchExport::import_data" is not in lowerCamel format
90 | WARNING | Unused variable $output.
98 | WARNING | Unused variable $key.
108 | ERROR | Doc comment is empty
111 | ERROR | Public method name "SolrSynonymUploaderBatchExport::import_data_finished" is not in lowerCamel format
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Controller/SolrSynonymUploaderTest.php
---------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------
3 | ERROR | Namespaced classes, interfaces and traits should not begin with a file doc comment
12 | ERROR | Doc comment is empty
17 | ERROR | Doc comment is empty
22 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
24 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/SynonymInterface.php
------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------
15 | WARNING | There must be no blank line following an inline comment
------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Entity/Synonym.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
226 | ERROR | The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Import/Importer.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
141 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
147 | ERROR | [x] Use null coalesce operator instead of ternary operator.
229 | ERROR | [ ] Type hint "array" missing for $result
229 | ERROR | [ ] Type hint "array" missing for $operations
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/src/Import/ImportPluginBase.php
-----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------
89 | WARNING | Unused variable $values.
95 | WARNING | Possible useless method overriding detected
-----------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/solr_search_synonym.links.action.yml
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/solr_search_synonym.install
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
43 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
44 | ERROR | [ ] Doc comment short description must end with a full stop
44 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
54 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
55 | ERROR | [x] Short array syntax must be used to define arrays
64 | WARNING | [x] A comma should follow the last multiline array item. Found: 'text'
70 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/solr_search_synonym.module
-------------------------------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AND 3 WARNINGS AFFECTING 18 LINES
-------------------------------------------------------------------------------------------------------------------------------
13 | WARNING | [ ] Global constants should not be used, move it to a class or interface
18 | WARNING | [ ] Global constants should not be used, move it to a class or interface
45 | ERROR | [x] Use null coalesce operator instead of ternary operator.
50 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
53 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
56 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
63 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
68 | WARNING | [x] A comma should follow the last multiline array item. Found: 0
71 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
77 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
79 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
83 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
104 | ERROR | [x] Parameter comment must end with a full stop
106 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
107 | ERROR | [x] Parameter comment must end with a full stop
109 | ERROR | [ ] Type hint "array" missing for $options
110 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
113 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/solr_search_synonym/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------
24 | WARNING | Line exceeds 80 characters; contains 176 characters
91 | WARNING | Line exceeds 80 characters; contains 168 characters
94 | WARNING | Line exceeds 80 characters; contains 81 characters
95 | WARNING | Line exceeds 80 characters; contains 390 characters
105 | WARNING | Line exceeds 80 characters; contains 110 characters
107 | WARNING | Line exceeds 80 characters; contains 195 characters
----------------------------------------------------------------------

Time: 319ms; Memory: 12MB

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇮🇳India ritviktak

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

Comments & Activities

Production build 0.69.0 2024