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

Write a generator script for custom components #37

Open
yuvalherziger opened this issue Aug 19, 2016 · 0 comments
Open

Write a generator script for custom components #37

yuvalherziger opened this issue Aug 19, 2016 · 0 comments

Comments

@yuvalherziger
Copy link
Collaborator

yuvalherziger commented Aug 19, 2016

This is a follow up on issue #36.
The idea is to write a script that automates the creation of custom parsers, custom exceptions and ideally other components in the library, so that something along the lines of...

$ /scripts/generate custom-parser -c MyCustomParser

...would create the following class:

namespace MPScholten\RequestParser;

class MyCustomParser extends AbstractValueParser
{
    protected function describe()
    {
        // TODO: describe the expected input, e.g. "a valid IP address"
        return "a ...";
    }

    protected function parse($value)
    {
        // TODO: handle type casting, validation, etc.
        return (string) $value;
    }

   ...
   ...
   ...
}
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

1 participant