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

Created on 11 July 2023, over 1 year ago
Updated 17 August 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/ai_image/src/GetAIImage.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
54 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
55 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
169 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
183 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
187 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
194 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/src/Form/AIImgForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
25 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
26 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
87 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/ai_image/src/Controller/AIImgController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
39 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
41 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig ai_image/

Remaining tasks

Patch review

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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

Comments & Activities

Production build 0.71.5 2024