Move everything to a `Factory`
tomudding opened this issue · comments
Instead of doing
'module_type_name' => static function (ContainerInterface $container) {
// ...
},
we should do it properly by using a Factory
:
ImportantClass::class => ImportantClassFactory::class,
This makes it easier to see, remember, and use the actual classes. Furthermore, it helps PHPStan actually checking if what we are $container->get()
ing exists and removes a lot of @var
type hints.