\Drupal calls should be avoided in classes

Created on 4 July 2023, over 1 year ago
Updated 11 July 2023, over 1 year ago

Problem/Motivation

\Drupal calls should be avoided in classes as it is the violation of phpcs standard.
As we run the command it gives us the following warning error

Steps to reproduce

1) Install the module.

2) Run this php code standard command to detect the errors reporeted by the php code sniffer.
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml /path/to/drupal/example_module

3) Mention the proper path of the file in which you want to detect the error.

4) once you run the command you will get the list of errors along with the file name.

Proposed resolution

Need to edit the code as per php coding standard.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Prachi6824

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