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.