Re: [PHP-DEV] RFC - making the Exception class abstract

2015-06-23 Thread Dan Ackroyd
Hi Kevin, Kevin Bradwick wrote: Too many times have I seen developers throwing Exceptions when what they really needed was something that gave it context like InvalidArgumentException or RuntimeException. Yes, I agree this is something to tackle at code review (and I do) but I feel PHP

Re: [PHP-DEV] RFC - making the Exception class abstract

2015-06-18 Thread Stanislav Malyshev
Hi! Too many times have I seen developers throwing Exceptions when what they really needed was something that gave it context like InvalidArgumentException or RuntimeException. Yes, I agree this is something to tackle at code review (and I do) but I feel PHP doesn't help the situation by

Re: [PHP-DEV] RFC - making the Exception class abstract

2015-06-17 Thread Johannes Schlüter
On Wed, 2015-06-17 at 17:30 -0400, Anthony Ferrara wrote: Changing the existing Exception class to be abstract would break a metric ton of code. Simply on that metric alone it would be a hard sell. I think you'd need an exceptionally strong justification for it, beyond using typed exceptions

Re: [PHP-DEV] RFC - making the Exception class abstract

2015-06-17 Thread Anthony Ferrara
Kevin, On Wed, Jun 17, 2015 at 4:41 PM, Kevin Bradwick kevinbradw...@gmail.com wrote: Hello! This is my first post to the internals list so please forgive me if I have not followed the rules precisely! I've had an idea to improve how developers use exceptions within PHP. I'd like to add an

[PHP-DEV] RFC - making the Exception class abstract

2015-06-17 Thread Kevin Bradwick
Hello! This is my first post to the internals list so please forgive me if I have not followed the rules precisely! I've had an idea to improve how developers use exceptions within PHP. I'd like to add an RFC but as per the instructions on the site https://wiki.php.net/rfc/howto, I am sending

Re: [PHP-DEV] RFC - making the Exception class abstract

2015-06-17 Thread Sebastian Bergmann
Am 17.06.2015 um 23:30 schrieb Anthony Ferrara: Instead, I think we should solve the problem with education. Perhaps the documentation can better detail out why devs shouldn't directly throw exception but instead use typed exceptions...? I remember all hell breaking lose when I disallowed