Fix the warnings/errors reported by PHP_CodeSniffer
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3373232. -->
Reported by: [roshni27](https://www.drupal.org/user/3769125)
Related to !1
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<pre>FILE: /home/lenovo/d7to9/web/modules/contrib/eca_webform/src/HookHandler.php<br>----------------------------------------------------------------------------------------------<br>FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE<br>----------------------------------------------------------------------------------------------<br> 146 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead<br>----------------------------------------------------------------------------------------------<br><br>Time: 259ms; Memory: 12MB</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig eca_webform/</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue