Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109908 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40749 invoked from network); 29 Apr 2020 10:33:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Apr 2020 10:33:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 54F291804C7 for ; Wed, 29 Apr 2020 02:07:07 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS 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-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 ; Wed, 29 Apr 2020 02:07:06 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id l19so1760988lje.10 for ; Wed, 29 Apr 2020 02:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YuC+gZ51ZB566Jy8ekZn6VGqRRuBfYRfgQdQPdS9NK4=; b=G5qfDYFHDWdznz8PXIZimUvkaPclGKh89KGopBnfh25BsH3Bvcr1kRnFikWUVPBTai WzAm5rq8u4R+A66zvVoJZ64cK5o7WMFyYiAUc8dYDgCICY89vE+IiShDLuEjiRkYNZQw Z2PTBdMpFMjyQhn8UbncVggy3aABJYLWz5sYTbFQSRlG9rcCvbeWX5ffgqFzZLjRiXVp pX66QbmG+E0cApbRaSgD6qbf03JR4ov0g/zUNNGHlorULUX4fpbGQvvnCcWJ7rLJEBfC s0JP949L7/BHeeaMpIKeL9rMLfXfliM3z9VM4P0MQGT5ORX03i4E4DgIFbA9TOoOyKzi JAxw== 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=YuC+gZ51ZB566Jy8ekZn6VGqRRuBfYRfgQdQPdS9NK4=; b=sKreekutK+2U3eaJqAgw4nr20I46Pd2iO5ijjVK3NWCs0cHIo3tv2LqNSf+bDC/RiG RDa/EJwZfPKN2I+a6O+5ltMdRWWEfqf6jui+V7pdlf+gFcxMekzAdPxpjYDbS5jES8SS H+HfeoWrBLayAIoUbOaPUgGuoFK50aQVoFHT2bb/BCKSeZ/91Z0lzreow/Yi5dXiAOWs /+WdwehyRD62KehiYevgRHqXSAfZtrMm267L89y+WD7mGazfj+yGTlMYLMAfnKvmYnUu 7eKZbXwWC1XAaiBDcrVz1ARDa/y+XNp6PozkWgXzJ2WDF1ddcObhREwRq2bZkVRG7hfL OuNA== X-Gm-Message-State: AGi0PubXbYarmIO2eHTzU8wxHbLT9NVwko/5YBGh51cjHsHlbRaAPpVJ jbaJJqcQ/nYc9FB8LRflyQQfVBaTPC3cSvObvE4= X-Google-Smtp-Source: APiQypIIB01rXIEaoZEHH3NJWoWF6aNfYZi/l/51QJzYr8t4B9994K0S1hhSg7kY341AOSSrsA3+znmDlX74ed+PPQE= X-Received: by 2002:a2e:85da:: with SMTP id h26mr19964999ljj.260.1588151224464; Wed, 29 Apr 2020 02:07:04 -0700 (PDT) MIME-Version: 1.0 References: <76b72148-4b3a-4a63-ab4c-245439a94823@www.fastmail.com> In-Reply-To: Date: Wed, 29 Apr 2020 11:06:48 +0200 Message-ID: To: Benjamin Eberlei Cc: Nicolas Grekas , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000957a5905a46a45aa" Subject: Re: [PHP-DEV] Re: [RFC] Constructor Property Promotion From: nikita.ppv@gmail.com (Nikita Popov) --000000000000957a5905a46a45aa Content-Type: text/plain; charset="UTF-8" On Wed, Apr 29, 2020 at 10:56 AM Benjamin Eberlei wrote: > > > On Wed, Apr 29, 2020 at 9:47 AM Nicolas Grekas < > nicolas.grekas+php@gmail.com> wrote: > >> > I think it might be best to apply to "both" and provide an isPromoted() >> > method on both ReflectionParameter and ReflectionProperty. Any code that >> > wishes to validate the allowed positions of an attribute can then skip >> > properties/parameters that report isPromoted() as true, to avoid >> reporting >> > false positives. >> > >> >> That sounds good. Deal on my side. >> > > Just to mention, any approach here potentially conflicts with anything we > consider for potential target validation on attributes, i.e. declaring for > an attribute that it is only allowed on a property OR an argument. > > At the point constructor promotion happens, we can also not look into the > attribute to see if its target=property or target=parameter, because this > would require triggering autoloader. > Does it really conflict though? Can't the target validation just ignore invalid attributes when promotion is involved (or rather, only check that the attribute is valid for either property or parameter, but not necessarily both of them)? Nikita --000000000000957a5905a46a45aa--