On Tuesday, December 5, 2017 8:17:49 PM CST Sara Golemon wrote: > On Monday, December 4, 2017 at 8:44:41 AM UTC-5, Woody Gilk wrote:
> > Regarding the exception interfaces: > > > > interface ClientException extends \Throwable > > > > Why Throwable instead of Exception or RuntimeException? > > > > For one: \Exception is a concrete class, \Throwable is an interface. An > > interface can't extend a concrete class. > > In this form, an implementation can easily extend \Exception in the process > of implementing ClientException (if it chooses to). > > class MyAwesomeHttpClientEcception extends \Exception implements > ClientException {...} > > -Sara Hm. Prior specs just defined an exception interface on its own, and said "y'all need to implement this in addition to extending whatever exception"[1] [2][3]. Of course, those specs were all PHP 5-compatible so Throwable wasn't a thing. If we continue that pattern in the future then making those exception interfaces extend Throwable makes a lot of sense, as it syntactically calls out what they're for while still giving implementers the ability to extend whatever base exception is most logical. I kind of like that. --Larry Garfield [1] http://www.php-fig.org/psr/psr-6/#cacheexception [2] http://www.php-fig.org/psr/psr-11/#32-psrcontainercontainerexceptioninterface [3] http://www.php-fig.org/psr/psr-16/#22-cacheexception -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscr...@googlegroups.com. To post to this group, send email to php-fig@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/4067880.0YbkAZ72Cm%40vulcan. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: This is a digitally signed message part.