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

Fluent interface for ConfigParser #38

Open
raphinesse opened this issue Aug 15, 2018 · 2 comments
Open

Fluent interface for ConfigParser #38

raphinesse opened this issue Aug 15, 2018 · 2 comments

Comments

@raphinesse
Copy link
Contributor

raphinesse commented Aug 15, 2018

Implement a Fluent interface for ConfigParser.

As a developer, I want to do

new ConfigParser('...')
    .addEngine(...)
    .addPlugin(...)
    .write();

Should be possible as a non-breaking change. If in doubt, we could export something like the following as a first step:

class FluentConfigParser extends ConfigParser {
    addPlugin (...args) {
        return (super.addPlugin(...args), this);
    }
    addEngine (...args) {
        return (super.addEngine(...args), this);
    }
}
@dpogue
Copy link
Member

dpogue commented Aug 15, 2018

This would be good, however I think we're wanting to move plugins/platforms out of ConfigParser (and hence config.xml). I'll make sure my suggestion for PackageHelper supports this though.

@raphinesse
Copy link
Contributor Author

raphinesse commented Aug 15, 2018

A Fluent Interface for all remaining non-getters is still desirable, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants