Coding standard issue | PHPCS

Created on 14 December 2022, over 2 years ago
Updated 9 August 2023, over 1 year ago

Getting the following errors and warning in PHPCS

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/google_index_api/google_index_api.links.task.yml
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/google_index_api/google_index_api.routing.yml
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
16 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/google_index_api/src/Form/SettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------
14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
68 | WARNING | [x] A comma should follow the last multiline array item. Found: "https://developers.google.com/search/apis/indexing-api/v3/prereqs"
75 | WARNING | [x] A comma should follow the last multiline array item. Found: "https://console.developers.google.com/apis/enabled"
81 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
89 | WARNING | [ ] #description values usually have to run through t() for translation
97 | WARNING | [ ] #description values usually have to run through t() for translation
117 | WARNING | [ ] Possible useless method overriding detected
131 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/google_index_api/src/Form/BulkUpdateForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 6 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
94 | ERROR | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
112 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
149 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
152 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
152 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/google_index_api/src/Batch/GoogleIndexApiBatch.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/google_index_api/src/Service/GoogleIndexApi.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
65 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
71 | WARNING | [x] A comma should follow the last multiline array item. Found: '/admin/config/services/google-index-api'
122 | WARNING | [x] A comma should follow the last multiline array item. Found: $url
----------------------------------------------------------------------------------------------------------------------

๐Ÿ› Bug report
Status

Closed: won't fix

Version

1.3

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia noorulshameera

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024