Drupal Coding Standards Issues | phpcs

Created on 3 March 2023, over 1 year ago
Updated 11 September 2023, 10 months ago

Problem/Motivation

FILE: ...Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/entity_reference_validators/tests/src/Functional/DuplicateEntityReferenceTest.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------
 31 | ERROR   | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
 57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/entity_reference_validators/tests/src/Functional/CircularEntityReferenceTest.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 10 WARNINGS AFFECTING 11 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------
 32 | ERROR   | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
 59 | 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
 61 | 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
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 76 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 86 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 93 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/entity_reference_validators/tests/src/Kernel/CircularEntityReferenceTest.php
-----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------
  55 | ERROR | The array declaration extends to column 147 (the limit is 80). The array content should be split up over multiple lines
  98 | ERROR | The array declaration extends to column 147 (the limit is 80). The array content should be split up over multiple lines
 107 | ERROR | The array declaration extends to column 147 (the limit is 80). The array content should be split up over multiple lines
 114 | ERROR | The array declaration extends to column 147 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/entity_reference_validators/entity_reference_validators.module
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------------------------------------
 17 | WARNING | Unused variable $key.
 49 | ERROR   | The array declaration extends to column 97 (the limit is 80). The array content should be split up over multiple lines
 59 | ERROR   | The array declaration extends to column 102 (the limit is 80). The array content should be split up over multiple lines
 76 | ERROR   | The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
 86 | ERROR   | The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines
 87 | ERROR   | The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------


FILE: ....goyal/Documents/MySites/10.1.x/drupal/modules/contrib/entity_reference_validators/src/Plugin/Validation/Constraint/CircularReferenceConstraint.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------
 29 | ERROR | [x] Expected "bool" but found "boolean" for @var tag in member variable comment
---------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: ...cuments/MySites/10.1.x/drupal/modules/contrib/entity_reference_validators/src/Plugin/Validation/Constraint/CircularReferenceConstraintValidator.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------------------------
 31 | ERROR | [x] Expected 1 blank line before function; 2 found
---------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 150ms; Memory: 10MB

Steps to reproduce

Run the following command : phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /drupal/modules/contrib/entity_reference_validators

Proposed resolution

Fix all the PHP coding standards issues and warnings.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇳India sahil.goyal

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

Production build 0.69.0 2024