I use php-di for autoloading classes in my API-Application.
For speed, however, php-di states that you have to autowire the classes manually for compilation. So they give us this example:
return [
// ... (your definitions)
UserController::class => autowire(),
BlogController::class => autowire(),
ProductController::class => autowire(),
// ...
];
I do not understand which classes we have to autowire for compilation. All classes? Or only the controllers?
As the application is pretty large, I can imagine how big this DiC config file will become. Not only that, but what if I create a new repository or model, then I should not forget to add it to my DiC config..