Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87252 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9036 invoked from network); 23 Jul 2015 17:54:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2015 17:54:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=ua.san.alex@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ua.san.alex@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: ua.san.alex@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-ig0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:33802] helo=mail-ig0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/61-00531-34A21B55 for ; Thu, 23 Jul 2015 13:54:11 -0400 Received: by igvi1 with SMTP id i1so18168000igv.1 for ; Thu, 23 Jul 2015 10:54:08 -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=luZnFdFTk0St8QAuLeNWU70dgGPBKjenKe7ZB4Bek0U=; b=x1oXwnB/98G4vBK1qEY9B8ih4iuUKm1+PZGNct37zngwp0uGty6r8JDQg8hsRSseYi KeTaz4zaQH9BNGcsCrQT9VW9SczIbudO0jgZgfzc3fJ2btygnzAQ2jx/+ut8A+VX1CNM oSOMJLBA5POmGjeoashmSwamDJ+kU4DmDdh7WrIPdA2GohLx263Dx1g4c3RcSGEjdZz7 JqE7BW2J/H4f9tGEDP2qpJfnNf56kmm7iIfWFvEd8xvAg47bFsfhTtvtXAJR+slBT6Ke /i6E76WFM+v6wEo6Xn+TmhLKeznR2+TL+TyPY73s9TcbktPSvTIyi1JLStv7edC6dXJZ bu8Q== MIME-Version: 1.0 X-Received: by 10.107.138.102 with SMTP id m99mr15939734iod.115.1437669201573; Thu, 23 Jul 2015 09:33:21 -0700 (PDT) Received: by 10.50.246.20 with HTTP; Thu, 23 Jul 2015 09:33:21 -0700 (PDT) In-Reply-To: References: Date: Thu, 23 Jul 2015 19:33:21 +0300 Message-ID: To: Marcio Almada Cc: Patrick ALLAERT , Marcio Almada , Yasuo Ohgaki , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: Voting choice for language changes (Was: "Re: [PHP-DEV][RFC][DISCUSSION] Strict Argument Count") From: ua.san.alex@gmail.com ("S.A.N") 2015-07-23 18:10 GMT+03:00 Marcio Almada : > Hi, you replied to the wrong thread ;) > > 2015-07-22 19:38 GMT-03:00 S.A.N : >> I am satisfied, the possibility of group declarations, but the that lack: >> >> > >> use App\RestException\ // name "RestException", not imported to >> current namespace :( >> { >> Gone, >> NotFound, >> BadRequest >> }; >> >> ?> >> >> Unfortunately have to write so: >> >> > >> use App\RestException; >> use App\RestException\{Gone, NotFound, BadRequest}; >> >> ?> >> >> It looks ugly and very strange. > > There is nothing strange on it (except, possibly, the trailing `\` > which was discussed to death and voted). > > 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. > >> My proposition, the imported end name, if end of without slash. >> >> Like this: >> >> > >> use App\RestException >> { >> Gone, >> NotFound, >> BadRequest >> }; >> >> echo RestException::class; // App\RestException >> >> ?> > > Importing from within a namespace is not the same thing as importing a > class. I'd be against it. > > 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. > > Marcio RestException is the base class for classes Gone, NotFound, BadRequest... He needed to catch all RestExceptions class. We do not use suffixes for names of exception classes, simple clear named classes of exceptions, this is our agreement.