-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
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;
}
...
...
...
}