Re: Proposal: Introduction of InvalidStateException

From: Date: Thu, 17 Oct 2013 17:54:19 +0000
Subject: Re: Proposal: Introduction of InvalidStateException
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Thu, 2013-10-17 at 15:30 +0200, Benjamin Schneider wrote:
> Hello,
> 
> I would like to propose the introduction of an 'InvalidStateException'
> into the SPL extension. Within the existing exceptions I am not able
> to find a type that would represent a state error, throwable if a
> method has been invoked at an illegal or inappropriate time.
> 
> I would be able to write the RFC and later on implement this new
> exception by myself, in case people share my opinion.

I'm a strong believer in "what hasn't to be in core should not be" and
these exceptions can easily be implemented in PHP. They have to be in C
when internal things should throw those.

True, doing this in PHP outside the core won't make those available
everywhere, but I believe that doing this in userland allows to simplify
adoption to changing needs in longterm and tools like Composer make it
possible to distribute even such small libraries in a good way with way
less trouble than a few years back.

johannes



Thread (14 messages)

« previous php.internals (#69648) next »