Drupal calls should be avoided in classes, use dependency injection instead

Created on 30 May 2023, over 1 year ago
Updated 18 June 2023, over 1 year ago

Problem/Motivation

remove WARNING \Drupal calls should be avoided in classes, use dependency injection instead

Steps to reproduce

Run the command:
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml instagram_posts_block/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: C:\xampp\htdocs\drupal_9\web\modules\contrib\instagram_posts_block\src\Plugin\Block\InstagramPostsBlock.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
82 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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