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

Created on 5 July 2023, 12 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/addthis_social_share/src/Form/AddThisSettingsForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 WARNINGS AFFECTING 56 LINES
------------------------------------------------------------------------------------------------------------------------------------------
39 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
205 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
237 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/addthis_social_share/src/Form/AddThisSettingsAdvancedForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
37 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
77 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/addthis_social_share/src/AddThisScriptManager.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
89 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
162 | 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 addthis_social_share/

Remaining tasks

Patch review

📌 Task
Status

Needs review

Version

1.2

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.69.0 2024