Services in forms should use dependency injection

Created on 7 March 2024, 10 months ago

Referred source
Running the command
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

I found this

FILE: /var/www/html/web/modules/contrib/conditional_fields/src/ConditionalFieldsElementAlterHelper.php
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
129 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead

FILE: /var/www/html/web/modules/contrib/conditional_fields/src/ConditionalFieldsFormHelper.php
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
324 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
📌 Task
Status

Needs work

Version

4.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024