Open generator
What is?
https://www.drupal.org/docs/drupal-apis/services-and-dependency-injecti…
Dependency injection is preferred method for accessing and using services.
How to use?
One option is to use service container in your existing controller (or create new) to access services.
Used template: https://github.com/Chi-teck/drupal-code-generator/blob/master/templates…
Technology