Drupal coding standard | phpcs

Created on 23 December 2022, almost 2 years ago
Updated 30 January 2024, 10 months ago

getting issues and warnings in phpcs

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/unique_field_ajax/tests/unique_field_ajax_test_hooks/unique_field_ajax_test_hooks.info.yml
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/unique_field_ajax/tests/src/Functional/UniqueFieldAjaxLanguageTest.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Whitespace found at end of line
37 | 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
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/unique_field_ajax/tests/src/Functional/UniqueFieldAjaxHooksTest.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Whitespace found at end of line
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/unique_field_ajax/tests/src/Functional/UniqueFieldAjaxBase.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------------------------
210 | 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
225 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
234 | 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
291 | 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/unique_field_ajax/unique_field_ajax.info.yml
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
6 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/unique_field_ajax/unique_field_ajax.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
274 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "_unique_field_ajax" but expected "unique_field_ajax__unique_field_ajax"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 677ms; Memory: 16MB

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India noorulshameera

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

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