GEWIS / gewisweb

GEWIS Website
https://gewis.nl
GNU General Public License v3.0
16 stars 33 forks source link

Move everything to a `Factory` #1824

Open tomudding opened 2 months ago

tomudding commented 2 months ago

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.