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

LazyAssertionException does not implement AssertionFailedException interface #166

Closed
redthor opened this issue Aug 11, 2016 · 4 comments
Closed

Comments

@redthor
Copy link

redthor commented Aug 11, 2016

Thanks for the library!

Is there any reason that Assert\LazyAssertionException does not extend Assert\InvalidArgumentException and therefore does not implement Assert\AssertionFailedException?

It'd be good to catch all exceptions from \Assert

@rquadling
Copy link
Contributor

rquadling commented Aug 11, 2016

\Assert\LazyAssertionException is, in essence, a collection of assertion exceptions.

You can use \Assert\LazyAssertionException::fromErrors() to get the assertion errors whilst in a catch(LazyAssertionException $ex){}

@rquadling
Copy link
Contributor

Having said that, if you want to implement the appropriate interface within \Assert\LazyAssertionException, make a pull request and we will review it.

@redthor
Copy link
Author

redthor commented Aug 12, 2016

There's an option to accomplish what I was after here: #167

@rquadling
Copy link
Contributor

Fixed in the next release.

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

No branches or pull requests

2 participants