Fix the warnings/errors reported by PHP_CodeSniffer

Created on 6 July 2023, 12 months ago
Updated 4 September 2023, 10 months ago

Problem/Motivation

FILE: /home/lenovo/druapl7to9/web/modules/contrib/many_selects/src/Plugin/Field/FieldWidget/OptionsManySelectWidget.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------
  7 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is
    |         |     Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsSelectWidget.
 25 | ERROR   | [x] Expected 2 spaces before interface name; 4 found
 87 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         |     $this->t() instead
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------

Time: 59ms; Memory: 10MB

Steps to reproduce

Execute Command : phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig many_selects/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India roshni27

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