-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Config value object instead of manually reading the file #47
Conversation
I think a config object is a very good idea – it gives a good place for input sanitisation (e.g. I think relative directory paths should always have no leading slash and should have a trailing slash), defaults, and documentation. I think unit/integration tests could be tidied up with a subclass with sensible defaults which could be extended. Your stringly typed approach misses out on a lot of benefits that could be gained with explicit getters and setters. And I'm hoping with the project PHP update and Pslam, you agree. I've built a class with all the composer/extra/mozart options as properties. I'm very much in draft status, but for discussion: I've been playing around with JsonMapper/JsonMapper but now I think cweiske/jsonmapper is worth a look – both for how I've also looked at Composer's own Factory::create() to parse I was also looking at Composer's |
Thank you @BrianHenryIE, even though we have parted ways on this project, for being a help in getting this done. I think Mozart is in a better place with this Config object in place, it sparked a ton of improvements and more test coverage. |
This can probably be improved a lot still, but I'd rather consider this a starting point for getting the next stable version out the door. This makes testing and also maintenance a lot easier to do. So I'm merging this in and will start preparing a release around it. |
I'd probably want to leave this out of 0.6.0, but haven't decided or full tested yet.