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

Created on 7 August 2023, 11 months ago

Problem/Motivation

as per drupal standred we should avoid drupal call inside class,

 public function locationCheck($woeid = NULL, $filter = '', $unit = 'f') {
    $settings = \Drupal::config('live_weather.settings')->get('settings');
    $data = '';

Steps to reproduce

file path src/LiveWeather.php.

Proposed resolution

use dependency injection

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Fixed

Version

2.5

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Shiv_Sharma

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

Comments & Activities

Production build 0.69.0 2024