Update with Drupal coding standards

Created on 2 September 2022, about 2 years ago
Updated 3 February 2023, almost 2 years ago

Problem/Motivation

Running a phpcs check reveals several issues.

FILE: /var/www/docroot/modules/custom/views_entity_embed/css/views_entity_embed.dialog.css
------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------
 16 | ERROR | Style definitions must end with a semicolon
 22 | ERROR | Style definitions must end with a semicolon
 28 | ERROR | Style definitions must end with a semicolon
------------------------------------------------------------------------------------------


FILE: /var/www/docroot/modules/custom/views_entity_embed/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
  9 | WARNING | Line exceeds 80 characters; contains 85 characters
 22 | WARNING | Line exceeds 80 characters; contains 111 characters
 24 | WARNING | Line exceeds 80 characters; contains 160 characters
 25 | WARNING | Line exceeds 80 characters; contains 165 characters
 26 | WARNING | Line exceeds 80 characters; contains 127 characters
 32 | WARNING | Line exceeds 80 characters; contains 187 characters
 34 | WARNING | Line exceeds 80 characters; contains 120 characters
----------------------------------------------------------------------


FILE: /var/www/docroot/modules/custom/views_entity_embed/src/Form/ViewsEmbedDialog.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 6 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
 124 | ERROR   | [x] Expected 1 space between type hint and argument "$form_state"; 0 found
 147 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 150 | ERROR   | [x] Expected 1 blank line after function; 0 found
 161 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 255 | WARNING | [x] '@TODO to be fix.' should match the format '@todo Fix problem X here.'
 285 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 391 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 397 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
 411 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 424 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/docroot/modules/custom/views_entity_embed/src/Plugin/EmbedType/EmbedViews.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------
  90 | WARNING | Unused variable $values.
 126 | WARNING | Unused variable $plugin_ids.
 127 | WARNING | Unused variable $id.
--------------------------------------------------------------------------------------------


FILE: /var/www/docroot/modules/custom/views_entity_embed/src/Plugin/CKEditorPlugin/DrupalViews.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 31 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 32 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

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

Proposed resolution

Update code for Drupal coding standards

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shelane

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