-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
[Refact] configuration class #283
[Refact] configuration class #283
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wauw, this is really clean, I love it ❤️
I think this will allow us to do a lot of extra stuff soo much easier in the future.
I only had a few comments about some naming, but else it just looks spot on
Resolve configuration when loading container Use dependency injection for configuration
666e5f1
to
e6a37e6
Compare
@olivernybroe Do you think you could test it in a Laravel application before merging ? To be sure the |
@Jibbarth Did not work in Laravel, gave the following error
|
cc761f4
to
1b7846d
Compare
@olivernybroe I think it's fixed now. Can you check the last commit and tell me if it looks correct for you ? 😅 I made my first Laravel install to fix this 🙌 |
It works, nicely done! 😄 Congratz on Laravel, now you gotta use it all the time ;) But, thanks for the refactor! ❤️ |
Thanks @Jibbarth for your work on this. |
In order to fix this comment, I add a Configuration Class that carry config provided by user.
The Configuration class is resolved when container boot, so we can use DependencyInjection or container to retrieve configuration.
So we don't have anymore the need to manually pass config everywhere we need it.
As phpcsfixer came with it, I use symfony/options-resolver to improve configuration validation.
I think this refact is needed, because the config file is growing, and we should have a simpler way to validate it, and also retrieve it.
WDYT ?