Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112017 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76029 invoked from network); 6 Oct 2020 17:07:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Oct 2020 17:07:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 30BBF18050A for ; Tue, 6 Oct 2020 09:20:35 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 ; Tue, 6 Oct 2020 09:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602001232; bh=+2E/xhcbZ2mM8q+NVPQXfRpwkVRicr5+EV3aSbd2dkg=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=R4HiWvYk4YyKzyPmr17WWdSsCAHnj31pHafn7OxhOCF5OG5uHHvvXkPPMqt5zd1kc WdxqiAALsuGRrDmvixmYaD+1/TRFRolCEgfnxSDPtAQ9cJ/pC+Pg0RXPTYW5Zhi7st Z+h54uTNFsvLh94D4pGYuJlfTbDvVnDUVXygAF0I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.43.75] ([109.41.194.203]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MWih0-1jsucK0xMu-00X65Z for ; Tue, 06 Oct 2020 18:20:32 +0200 To: internals@lists.php.net References: Message-ID: <33f82702-6126-fa36-48d6-71487cae1b72@gmx.net> Date: Tue, 6 Oct 2020 18:20:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:Rm5oWyOQDQJEYuCQTFn+o4eP07M2Pmj9FW6Z3X8bd7okKpm/dzs P7O2WL+apF5Gh1cVC4N6uOA5+n9qNekKRkNqaDedFYKXmLlvaQi6fbi6nbtAUbAQEDySN50 +Yi7Sig83IkGIuNEHhqHb7T69+bDb6dmrqAdTxGCDZSoEEw/KDZMM9ePIuNf97I+AGJlQan JO6j1WJ6lFD34Yj18q0VQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:VyZzfGf4/M8=:8fyiaaQZuN3X26HARKogcI o95X8ge4uussZVZAmEbliCfxVH6b+4Gyqk8YzPMcMjRy2J0FQmY/VKw9vcrINageGZlRyOaRs X/0PhL5x1Dpj2gzP1Nu1oi3OiifbQTAsakjNZ+J3dIRpRmdnzETro9ptb/xogaF6UNkKD0t16 iOj380JmQ+FOdo3byB/suuBrSNDyW545I2kvOLq9/DpwmJgtsR9PyUbqOtd+DchbrljScH1Pd z4CQnUqPMI24YcPGxXUqjBr9xYlK36d+aLXB6ABOiJzsRjzxZWWR4g4OcGbeU2m5yZtQmkb7f e+rqmNOqwqZv4HU4S+GRMhiV5H5gE1TmDP+6p2XABPflHL23/zgp3YDReLIXcaOzie3zj/6m9 Dy9W5KlbA/sfZSwMBLZ52dPimm5tp7bMaLX09/MoFDiKO4jFAPji+gUn6UMkVqnanGuf4cnyS 6VoIku6DAov+W5lrVzHdmC6cx8ceurw/bIT7ano25jJ1dBQaCJ7JLr3Ajz5Hv0nAqmtb4T0Il YeVpjY2YIxnwqjQxWKCmJbLgzxbPvcB9dD/JRUGOdeavKeApn2E/vd3uBKH9UNLe7POkdr79q 7Qf5Dicuw3yMD8E1jLHVKQa/4T/kmlQ+bdVRjxjjKkNzpQ38n86oGSBoKke3r0xR5Tt8XI1JC ex615TOueFAi8lnrqLye8xc01ZX/cPCanERD1c6RFjm5l0K/qfTnNyQPqbLQxM/FewLxX40pv lDC+gjbx69Dh0Za0waQOBlNsTw2HZEghka0Xtv3WJvENe9iFOMmwFb3VLwbp5eBhqUWt9qxva ArgaXk0C8DnQYMBxNTyCRr/5WtuDqr37kWxKoGcFhNbj3HxPad7+d8DZJurlFqy0QxS38x0ZE e2UbGeyPsZ1xdU+My1ah9XaGgM5c3SWnCsRIZXEDc/pmaDeW7qJ9oJ3wg7w9kdVZDNUcuVszo qs1as7N9voidbryZ04E01E8vDzTZt/denluuiEjJZTzzTFq0fADUjwVYKJq/xg1JKmEQ6XJWa lkIKAQekkQCut9mePsEWgehbvMpXrzaN9FyWNYBgTJY7+rv0e9yO/yNtb5RQxzMBKEETpiSRb nAOSdTrrYcpQhgsrht7hy2DZCMIsnHNVQNI1HYxWx2MY+PxVWKHVBE8fNx8RmJfe5IDP5v0xE aNTg1xSF8lmwA1HhAA1tn56I+qf2V0xfLA58rJORUzZSat1uCaDyROkT5sCJzQmUdq9/sr3ng g3uoK497g4cROkmY9mQuGdIotKF9rCCfKkBiJEA== Subject: Re: [PHP-DEV] Attributes and constructor property promotion From: a.leathley@gmx.net (Andreas Leathley) On 06.10.20 17:15, Sara Golemon wrote: > My opinion on constructor property promotion (CPP) is that it's somethin= g > for small value object classes and should probably be regarded as > code-smell on larger classes. At the same time, annotations belong with > more complex objects and not so much with small "struct-like" classes. > > Given that position, I think we should err towards strictness in how > attributes are applied to CPP declarations. That is, we should require > them to be meaningfully applicable to both arguments and properties in > order to be used in a CPP context. If that's a problem for the consumer= , > then they should avoid use of CPP. > > -Sara The current usage of annotations is quite often with small struct-like classes though - I mainly use annotations (and will use attributes) for data that needs to be validated, or entity-like classes that contain data. Those classes are small and simple and would benefit greatly from CPP and attributes used in combination, so it would be a pity to make that impossible. From my understanding suppressing the validation errors in this particular case would be a good solution, or are there any serious downsides to that?