Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111947 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72246 invoked from network); 28 Sep 2020 14:05:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Sep 2020 14:05:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C3478180510 for ; Mon, 28 Sep 2020 06:17:02 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.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, 28 Sep 2020 06:17:02 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id nw23so8454990ejb.4 for ; Mon, 28 Sep 2020 06:17:02 -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=DC4UzjicMM6S7Z5BxqpFkvJ9anHAAjOCdfTZO8F38JU=; b=IKxPT5lZFKqTzSXwRedWOz1QdSRJ5xObFrqNMoP9imcg9nSX6JIX4Cnzu+e92zQF28 DI5y6kkOPUQjBQ+v18OmRKSLRIp44LMhC3qIGxCNJcXblv6uPWtgRMQn51q3CzcK8IyW qS3w3KpvOKWd/dCNj40lE0RSDMCy7fai0anlIW2Wb/ADPp5cqOV1rpsnO86DTTupL76q tiuREXdjKedQnlmMmr1ew94uPPeyhAR6hZqPHKHhlNh2mI1FEQ13A8+bD3WuSchue9Qh bbdIQKv/q5KNW/tLSPSzT83BJLTdgyQU5yOEiTZDBQqQ90TH/F5ZuaMqwRQ1WezaMJQT aZ5Q== 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=DC4UzjicMM6S7Z5BxqpFkvJ9anHAAjOCdfTZO8F38JU=; b=gkF7iR0fbe0Y+7yV90DGvJ8cJsnkmI0ZBHa+rTCNaFvGajuR4k1JNxLkK47jet5LUP vLgyewvvlRLfWvyNGGSKOVDnVm6t328FBvzp2yvvhvivPLQo17UC0HdzthYsinoRLdsY Ln24wHuhM+bex7YxzCQE6C3GG8f/pwOsW58gB830dRaT0sucdXf6lUaE76Axp6K7yFdN WfLL4rNe3zJb6m53HuWb/WOnXngho4hZZvQWlBGKGGNlzDQcjkWZoU6KGpi6S4iyiJ5f DKgye42ycESq68l9HOP3palq3cZRvMbNvMJn5MEe0OIopPfIUCMKgtrNojx7VnnRniqm e+CA== X-Gm-Message-State: AOAM530BnZnTqf2A47B2NG1kRb/+iM5IqSH2mrN46C5hAYWKss1I01qM /mHj4AjWuX28Xqigl3DwbzA5TCmRkn1c/pQ7luE= X-Google-Smtp-Source: ABdhPJyLkCotdITwmSfdUABbLF4imcOzkLuvjCPmBhz4SoMNvjm/q3zNEykKeX2jvxHYC5Lt8cNBj+4G61d5F2V2Bfo= X-Received: by 2002:a17:906:3ac5:: with SMTP id z5mr1605177ejd.46.1601299020153; Mon, 28 Sep 2020 06:17:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 28 Sep 2020 15:16:45 +0200 Message-ID: To: Benjamin Eberlei Cc: Benjamin Morel , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary="0000000000004688c805b05f7b7f" Subject: Re: [PHP-DEV] Re: Attributes and constructor property promotion From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000004688c805b05f7b7f Content-Type: text/plain; charset="UTF-8" > > >> imho, we should pick the 80% use-case and advise to desugar the code if > >> other behavior is desired. For me the 80% case is that the attribute > only > >> applies to the property, not to the parameter. > > > > > > +1 for the desugaring advice in this case, however as a matter of > > consistency I'd rather have it either apply to both the property and the > > parameter, or just throw an exception if used on promoted properties, > > whatever the 80% use-case is (source?) > > > > We should assume that there are very few attributes that make sense to > apply to *both* a property and an argument. I can't find any good example > where this makes sense. > > Library developers shouldn't be forced to allow target argument only that > it works in the ctor promotion case. > > I assume the 80% case is properties, because attributes did not have > docblock annotations yet, that means this use-case isn't even possible at > the moment. Yet annotations on properties are widespread (Doctrine ORM, > symfony validator, ...). > I'm 100% with Benjamin here, this is what will be the most useful to me also. --0000000000004688c805b05f7b7f--