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

Support for value objects #19

Open
nbish11 opened this issue Jan 17, 2023 · 0 comments
Open

Support for value objects #19

nbish11 opened this issue Jan 17, 2023 · 0 comments
Assignees
Labels

Comments

@nbish11
Copy link
Contributor

nbish11 commented Jan 17, 2023

You could have something like this in your request handler:

public function handle(MyProjectNamespace\Domain\ValueObject\Email $email)
{
    ...
}

The router will then attempt to instantiate the value object and pass through the appropriate url segment. If the constructor throws an exception, then the router should determine the appropriate status code to return. (e.g. 400 for invalid argument, 500 for runtime exception. ) If the value object successfully instantiates, it will be added to the route args list as an instance.

@nbish11 nbish11 added this to the Version 0.10.0 milestone Jan 17, 2023
@nbish11 nbish11 self-assigned this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant