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

Created on 8 June 2023, over 1 year ago

Problem/Motivation

The error in the title occurs in the MenuItems.php file.

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Use dependency injection and container to replace direct calls.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sidharth_soman
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India sidharth_soman Bangalore

    Working on it.

  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sidharth_soman Bangalore

    I am leaving the call to menuTree() as it is for now since I presume that it's being used to create a separate instance different to the current menu tree object.
    I've added a dependency injection for the request service.

    Please review the MR.

Production build 0.71.5 2024