Use Dependency Injection (DI) instead of calling the Drupal::service() method directly
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3522372. --> Reported by: [anjaliprasannan](https://www.drupal.org/user/3637917) Related to !100 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Use Dependency Injection (DI) instead of calling the Drupal::service() method directly.<br> Instead of calling the Drupal services directly use the DI for code maintainability in ai_agents_form_integration</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Update the code in<br> ContentTypeGeneration.php<br> FieldTypeGeneration.php<br> WebformBatchJob.php</p> <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