Open tomudding opened 2 months ago
Instead of doing
'module_type_name' => static function (ContainerInterface $container) { // ... },
we should do it properly by using a Factory:
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.
$container->get()
@var
Instead of doing
we should do it properly by using a
Factory
: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.