Fix the issues reported by phpcs

Created on 18 July 2023, over 1 year ago

Problem/Motivation

$ phpcs --standard=Drupalpractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml before_after

FILE: ...before_after\src\Plugin\Field\FieldFormatter\BeforeAfterFieldFormatter.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------
110 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
113 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
141 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
144 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
148 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
151 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
165 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
174 | WARNING | ImageStyle::load calls should be avoided in classes, use
| | dependency injection instead
--------------------------------------------------------------------------------

Time: 1.39 secs; Memory: 6MB

Proposed resolution

Create a patch.

Remaining tasks

FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
166 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
175 | WARNING | ImageStyle::load calls should be avoided in classes, use
| | dependency injection instead

📌 Task
Status

Closed: cannot reproduce

Version

2.2

Component

Code

Created by

🇮🇳India Priya_Degwekar

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.71.5 2024