**To reproduce:** - Run phpstan ```` php ../../../../vendor/bin/phpstan.phar analyse --memory-limit=256M . ```` **- Output:** <img width="1027" alt="image" src="https://github.com/digitalutsc/islandora_breadcrumbs/assets/7862086/39d7deee-8ea7-4aee-925f-e78454930abb"> **Diagnose:** Calling directly Drupal service is not Drupal code standard, Need to change the code to Dependency injection to pass phpstan. Example: https://www.drupal.org/files/issues/2022-07-14/Drupal-calls-should-be-avoided-in-classes-3296033-2.patch **Resource:** https://drupalize.me/topic/dependency-injection
To reproduce:
- Output:
Diagnose:
Calling directly Drupal service is not Drupal code standard, Need to change the code to Dependency injection to pass phpstan.
Example: https://www.drupal.org/files/issues/2022-07-14/Drupal-calls-should-be-avoided-in-classes-3296033-2.patch
Resource:
https://drupalize.me/topic/dependency-injection