Problem/Motivation
FILE: ..._html_field/src/Plugin/Field/FieldFormatter/ReadonlyHtmlFieldFormatter.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
23 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
24 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
FILE: ...adonly_html_field/src/Plugin/Field/FieldWidget/ReadonlyHtmlFieldWidget.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
24 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
25 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
38 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
39 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
Time: 330ms; Memory: 10MB
Steps to reproduce
Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig readonly_html_field/
Proposed resolution
Add dependency injection
Remaining tasks
Patch review.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3365003 - after.png | 143.37 KB | kenyoowen |
| #2 | 3365003 - before.png | 286.06 KB | kenyoowen |
| dependency-injections.patch | 7.53 KB | urvashi_vora |
Comments
Comment #2
kenyoowen commentedHi urvashi_vora
I applied patch dependency-injections.patch and confirmed that the Dependency injection issues mentioned are resolved. Please see the screenshots attached.
For your review.
Thank you.
Comment #3
akram zairig commentedHello , i've tested the patch on comment #2 , it's working and respecting dependency injection.
Comment #5
b.khouyThanks guys!
Patch has been committed, please update to the latest version of Readonly Html Field module.
Comment #6
b.khouy