Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69628 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75063 invoked from network); 17 Oct 2013 14:46:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 14:46:28 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.48 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.48 mail-oa0-f48.google.com Received: from [209.85.219.48] ([209.85.219.48:48780] helo=mail-oa0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/5D-12663-248FF525 for ; Thu, 17 Oct 2013 10:46:27 -0400 Received: by mail-oa0-f48.google.com with SMTP id m17so1694028oag.7 for ; Thu, 17 Oct 2013 07:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=98mNanMEj+wOcgrmKsfOGMEDhcmmFWZbtGUyF52TrFw=; b=QUSufdZODDEmWidpDhVWCWthc7QtU6Z36CX4I2//cINx/kPIUDmrpxnM+zvfOF6Bpk E4vSuIt/VxSqiX/2TDXPRXrqxJ2Z053z5hEJ2krPWMtyTtFKgo6TIobozvuXzaIORsYA eR0W9Ps4uXuVFs0pyVC5dXyGTE13SA/dij4ha8BBq1PzKhtyF9Q9rKP9IlXOmbi38Deg tDeK+y4BwtukNNqtiPD+XJ0COs4579GUw6a2fkOqWd9L/gqLdLzqpyvfrTVCBPH5wEd5 prHzQG3tk/3Wcy6oeGMNf9QSvmOB26NQvPcqtWY3jmCdeU4Iv68rascnOqcAHTaxh+Gw RBxg== MIME-Version: 1.0 X-Received: by 10.182.227.136 with SMTP id sa8mr14317201obc.39.1382021183732; Thu, 17 Oct 2013 07:46:23 -0700 (PDT) Received: by 10.76.12.135 with HTTP; Thu, 17 Oct 2013 07:46:23 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Oct 2013 08:46:23 -0600 Message-ID: To: "guilhermeblanco@gmail.com" Cc: Benjamin Schneider , internals Content-Type: multipart/alternative; boundary=001a11c30350ba802d04e8f0e171 Subject: Re: [PHP-DEV] Proposal: Introduction of InvalidStateException From: morrison.levi@gmail.com (Levi Morrison) --001a11c30350ba802d04e8f0e171 Content-Type: text/plain; charset=ISO-8859-1 > > 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. >> >> Exceptions are one part of the SPL that are a nasty, poorly thought-out >> mess (no offense to anyone who worked on it; this stuff is harder than >> people realize). I am -1 on simply adding another exception to our mess, >> but if we can clean it up then I might support it, depending on details. > > > I'd love to listen your ideas/suggestions. Maybe we can implement an RFC > to make it better. > Without exposure to problems, there are no problems at all. > > I'm not saying it's perfect, but would love ideas on how we can improve > it. =) > As an example of my idea of progress: https://github.com/morrisonlevi/Ardent/blob/master/Exceptions.md - DomainException - FunctionException - LookupException (The two sub-classes here may be unnecessary; just one may do) - IndexException - KeyException - StateException - EmptyException - FullException - TypeException Of course, this is not backwards compatible. It does, however, include a StateException that is relevant here. I'm not implying that my exceptions hierarchy is complete, but a good deal of thought and use has gone into them so far. --001a11c30350ba802d04e8f0e171--