Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87297 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69826 invoked from network); 26 Jul 2015 05:58:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2015 05:58:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.46 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.220.46 mail-pa0-f46.google.com Received: from [209.85.220.46] ([209.85.220.46:33635] helo=mail-pa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/00-02931-EE674B55 for ; Sun, 26 Jul 2015 01:58:08 -0400 Received: by padck2 with SMTP id ck2so34300379pad.0 for ; Sat, 25 Jul 2015 22:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=daMOW+RezCQ9O+t3aICDlElUKnaFL/tXKF8ot5qO0t8=; b=D4asbJLmXGxHQN/hreT8dWGfMHmhe7biCPKJbPXaqE/g7VClJNv+7+qi4HaLG0Ivnf llFoNFFrW8S35ZA31qj88CxbDyV09g9YroRgeL1LRYqQEe9wm6wBkPpzKeeuQNqmChPJ e0BK53vqk8uAPszLjv1AJ5HosfMbtre5A8VYY+VIZwOu1u1TXf/btIoZfJHGvSeXV8tN gMuZvl1w6g4QjzL5/QXsrsnvr17cuLyg8ypXWryuXarHRcY0/qgU4xYHlUFUxKwEjOrf LeaftGdCcCMuCtN48bUBCA7m20769yP+pRQN3AST8pc5qqj3H1iJ+mbb92N7/mUVvPYH iz0g== X-Received: by 10.66.245.142 with SMTP id xo14mr51000524pac.151.1437890283063; Sat, 25 Jul 2015 22:58:03 -0700 (PDT) Received: from [192.168.0.2] (115-64-165-88.static.tpgi.com.au. [115.64.165.88]) by smtp.gmail.com with ESMTPSA id jg7sm1622237pac.1.2015.07.25.22.58.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 25 Jul 2015 22:58:01 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <1AE1CE66-869C-44E8-A961-86DE8D05909C@gmail.com> Cc: Marcio Almada , Patrick ALLAERT , Marcio Almada , Yasuo Ohgaki , PHP internals X-Mailer: iPhone Mail (11D257) Date: Sun, 26 Jul 2015 15:57:56 +1000 To: "S.A.N" Subject: Re: [PHP-DEV] Re: Voting choice for language changes (Was: "Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count") From: davidkmuir@gmail.com (David Muir) > On 24 Jul 2015, at 2:33 am, "S.A.N" wrote: >=20 > 2015-07-23 18:10 GMT+03:00 Marcio Almada : >> Hi, you replied to the wrong thread ;) >>=20 >> 2015-07-22 19:38 GMT-03:00 S.A.N : >>> I am satisfied, the possibility of group declarations, but the that lack= : >>>=20 >>> >>=20 >>> use App\RestException\ // name "RestException", not imported to >>> current namespace :( >>> { >>> Gone, >>> NotFound, >>> BadRequest >>> }; >>>=20 >>> ?> >>>=20 >>> Unfortunately have to write so: >>>=20 >>> >>=20 >>> use App\RestException; >>> use App\RestException\{Gone, NotFound, BadRequest}; >>>=20 >>> ?> >>>=20 >>> It looks ugly and very strange. >>=20 >> There is nothing strange on it (except, possibly, the trailing `\` >> which was discussed to death and voted). >>=20 >> Even if we had no trailing '\' it wouldn't make any sense to import >> "App\RestException" when "use App\RestException{Gone, NotFound, >> BadRequest};" is used. >>=20 >>> My proposition, the imported end name, if end of without slash. >>>=20 >>> Like this: >>>=20 >>> >>=20 >>> use App\RestException >>> { >>> Gone, >>> NotFound, >>> BadRequest >>> }; >>>=20 >>> echo RestException::class; // App\RestException >>>=20 >>> ?> >>=20 >> Importing from within a namespace is not the same thing as importing a >> class. I'd be against it. >>=20 >> My 2 cents: why do you have "RestException" with "Exception" suffix >> and then don't have the same suffix on the other exception names? This >> unpredictable exception hierarchy is the "ugly" part and subtle >> alternative syntax won't make it better, IMMO. >>=20 >> Marcio >=20 > RestException is the base class for classes Gone, NotFound, BadRequest... > He needed to catch all RestExceptions class. >=20 > We do not use suffixes for names of exception classes, simple clear > named classes of exceptions, this is our agreement. >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 Then why not put the base class in the namespace of which it is a base class= for? Cheers, David