Fix the issues reported by PHP_CodeSniffer

Created on 23 January 2023, almost 2 years ago
Updated 18 January 2024, 10 months ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme modules/custom/codesnippet/ shows the following warnings/errors, which should be fixed.

FILE: src/Plugin/CKEditorPlugin/CodeSnippet.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------
 74 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 79 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 95 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------
๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Jay Jangid

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024