Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108910 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96861 invoked from network); 9 Mar 2020 18:06:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Mar 2020 18:06:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CB31B18054F for ; Mon, 9 Mar 2020 09:27:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 9 Mar 2020 09:27:33 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id 6so150581wmi.5 for ; Mon, 09 Mar 2020 09:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=85b6W993PBh2XNyv2DbVirWT1lKhutZ7RpOSovq0Zbk=; b=N+hz7gSovErriXOnPpRn2NJF+uI3V6XRumrXysy/HRn8aayEZr1PsiVXHBG31nxtRY vFz8vZWUuwVyZv/RZiaJ9JRTK3ghsAxJuf4/FvArrJV15ByRE1zm8/9dF/H/8K82xG8F FNkYOZ3ooCwv/vH1TClLeTlOi+Aj3iAgleZUkCYad3lbsVfLQ0YcyY924Lxoy4IConr+ tgs3dS6DYMqr2lqP8jaU2+lT8UsnfG5HSJmIiwuTagzaV+yN6DP2k9xK2+wuY9lFKcyI GX6F/sdT8to53+qZ3GUzYAK73XWTMz2uYVb916GprP5CYqOwsaJUeNZme45CSLODTA0r 0skQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=85b6W993PBh2XNyv2DbVirWT1lKhutZ7RpOSovq0Zbk=; b=SQPfGxHE9rW1NSwBGpuvaUeTM2Lu8/CtTa7o8gPM5bpEOt3vsFTn0/doIA61AGwmON 1pUV57am2Pa1GMqKi9Ty0lMyV1HXA8IK69AO2zYljJrN8fEIaYjrNVxt8oMQNVMPiMRs gQ4ilave2xX+f+JNSjsMO1EcZLwiC2bSeciY+O5rs+3WuK+WL6R1cSR6QLbAKtw64SNI 7721Geo+q1YtKrA8ZamuckC0abEqqX5lYs7fmWdzwcu0POPjr0xJClp449K1yAKm0FVu f3uhv+4klMFaIWssXFhecd2GuA2PeQFDQlYqvM5F8SfoVledH+3E58wlSL0IHJSk0msq P3nQ== X-Gm-Message-State: ANhLgQ0p6psgl89lHWxXAahl6q6pWCyfUcg5UXsMU8AWgLsmekghgTZq rLoFbJgguQA6y2HHlUocg/4MW0L39mo+V0WP0AOmqw== X-Google-Smtp-Source: ADFU+vvnJ4TU+oQ0OOHbKzgUZf7PSwVhJmc1t5Vueg9D/J/iTK2l437gL09DPY2I4d8b+Bqp+PPFGoL48vxxCrcLx7U= X-Received: by 2002:a1c:2d86:: with SMTP id t128mr130618wmt.38.1583771250379; Mon, 09 Mar 2020 09:27:30 -0700 (PDT) MIME-Version: 1.0 References: <7BAB0436-03EC-4183-BA5A-5A165DAE806E@koalephant.com> In-Reply-To: <7BAB0436-03EC-4183-BA5A-5A165DAE806E@koalephant.com> Date: Mon, 9 Mar 2020 17:27:19 +0100 Message-ID: To: Stephen Reay Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000c8e08705a06e7ae4" Subject: Re: [PHP-DEV] [RFC] Attributes v2 From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000c8e08705a06e7ae4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 9, 2020 at 5:18 PM Stephen Reay wrote: > > > > On 9 Mar 2020, at 21:42, Benjamin Eberlei wrote: > > > > Hi all, > > > > I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in > > 2016 with a few changes, incorporating feedback from the mailing list > back > > then and from talking to previous no voters. > > > > The RFC is at https://wiki.php.net/rfc/attributes_v2 > > > > A working patch is at https://github.com/beberlei/php-src/pull/2 though > > work around the details is still necessary. > > > > The RFC contains a section with common criticism and objections to > > attributes, and I hope to have collected and responded to a good amount > > already from previous discussions. > > > > There is also a fair amount of implementation detail still up for debat= e, > > which is noted in "Open Issues". I have pre-committed to one approach, > but > > listed alternatives there. On these issues I am looking for your > feedback. > > > > greetings > > Benjamin > > Hi Benjamin, > > I can=E2=80=99t comment on the feasibility of this RFC or the patch, but = I like > the approach it takes to this =E2=80=98problem=E2=80=99. I can already im= agine a number of > =E2=80=98nicer=E2=80=99 ways to achieve similar/same results using this, = so thanks for > taking up the baton! > > My one small query/request is about the `Reflection*::getAttributes` > method. Is there a philosophical and/or technological reason for why it c= an > only =E2=80=98filter=E2=80=99 the attributes by a single given name, rath= er than being > variadic and filtering against multiple names (i.e. returning those that > match any of the given names)? I would imagine many uses (particularly > within libraries) would end up wanting to retrieve multiple attribute typ= es > they=E2=80=99re aware of all at once, no? > The name filtering works when using a common base class or interface, so if a library has a class "My\BaseAttribute" and all related attributes extend from it, then in the code you can do: $attributes =3D $reflectionClass->getAttributes(\My\BaseAttribute::class); This would return all attributes matching. > > > Cheers > > > Stephen --000000000000c8e08705a06e7ae4--