Skip to content

Write a generator script for custom components #37

@yuvalherziger

Description

@yuvalherziger

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

   ...
   ...
   ...
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions