Drupal Coding Standards Issues | phpcs

Created on 19 January 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings
FILE: /var/www/html/modules/contrib/extra_image_field_classes/src/Plugin/Field/FieldFormatter/ExtraImageFieldClassesFormatter.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
26 | ERROR | [x] Short array syntax must be used to define arrays
35 | ERROR | [x] Short array syntax must be used to define arrays
37 | 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
50 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
50 | ERROR | [x] Short array syntax must be used to define arrays
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.87 secs; Memory: 6MB

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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

Merge Requests

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