whiteoctober / Pagerfanta

Pagination for PHP.
Other
1.59k stars 2 forks source link

Let exception interface extend throwable #273

Closed BackEndTea closed 5 years ago

sampart commented 5 years ago

Good thinking, @BackEndTea. However, http://php.net/manual/en/class.throwable.php says:

PHP classes cannot implement the Throwable interface directly, and must instead extend Exception.

Do you therefore need to change this to extend \Exception?

BackEndTea commented 5 years ago

If the exception interface was a class then yes, but interfaces are allowed to extend \Throwable. It just means that this interface can only be implemented by classes extending \Exception, which is the intention anyways.

A non exception class implementing \Throwable, (or another interace extending it), would cause a fatal error.

sampart commented 5 years ago

Ah, perfect. Thanks for clarifying, and for contributing. I've merged this now. Do you need a release making?

BackEndTea commented 5 years ago

Thanks for the merge; I don't need a direct release, i just noticed it while looking at the code.