Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move everything to a Factory #1824

Open
tomudding opened this issue Apr 30, 2024 · 0 comments · May be fixed by #1951
Open

Move everything to a Factory #1824

tomudding opened this issue Apr 30, 2024 · 0 comments · May be fixed by #1951
Assignees
Labels
For: Code For issues which specifically relates to the code, not its functionality. Module: Application For anything related to the Application module Module: Company For anything related to the Company module Module: Decision For anything related to the Decision module Module: Education For anything related to the Education module Module: Frontpage For anything related to the Frontpage module Module: Photo For anything related to the Photo module Module: User For anything related to the User module php Pull requests that update Php code

Comments

@tomudding
Copy link
Member

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.

@tomudding tomudding added For: Code For issues which specifically relates to the code, not its functionality. Module: Application For anything related to the Application module Module: Company For anything related to the Company module Module: Decision For anything related to the Decision module Module: Education For anything related to the Education module Module: Frontpage For anything related to the Frontpage module Module: Photo For anything related to the Photo module Module: User For anything related to the User module php Pull requests that update Php code labels Apr 30, 2024
@tomudding tomudding self-assigned this Apr 30, 2024
@tomudding tomudding linked a pull request Dec 25, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For: Code For issues which specifically relates to the code, not its functionality. Module: Application For anything related to the Application module Module: Company For anything related to the Company module Module: Decision For anything related to the Decision module Module: Education For anything related to the Education module Module: Frontpage For anything related to the Frontpage module Module: Photo For anything related to the Photo module Module: User For anything related to the User module php Pull requests that update Php code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant