Re: [PHP-DEV] Attributes and constructor property promotion

2020-10-07 Thread Nikita Popov
On Tue, Oct 6, 2020 at 6:59 PM Rowan Tommins wrote: > On Tue, 6 Oct 2020 at 17:20, Andreas Leathley wrote: > > > From my understanding suppressing the validation errors in this > > particular case would be a good solution, or are there any serious > > downsides to that? > > > > > The downside

Re: [PHP-DEV] Attributes and constructor property promotion

2020-10-07 Thread Markus Fischer
Hi! On 06.10.20 17:15, Sara Golemon wrote: My opinion on constructor property promotion (CPP) is that it's something 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

Re: [PHP-DEV] Attributes and constructor property promotion

2020-10-06 Thread Benjamin Eberlei
On Tue, Oct 6, 2020 at 6:21 PM Andreas Leathley wrote: > On 06.10.20 17:15, Sara Golemon wrote: > > My opinion on constructor property promotion (CPP) is that it's something > > for small value object classes and should probably be regarded as > > code-smell on larger classes. At the same time,

Re: [PHP-DEV] Attributes and constructor property promotion

2020-10-06 Thread Rowan Tommins
On Tue, 6 Oct 2020 at 17:20, Andreas Leathley wrote: > From my understanding suppressing the validation errors in this > particular case would be a good solution, or are there any serious > downsides to that? > The downside presumably is that a library author could implement an attribute with

Re: [PHP-DEV] Attributes and constructor property promotion

2020-10-06 Thread Andreas Leathley
On 06.10.20 17:15, Sara Golemon wrote: My opinion on constructor property promotion (CPP) is that it's something 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

Re: [PHP-DEV] Attributes and constructor property promotion

2020-10-06 Thread Sara Golemon
On Mon, Sep 28, 2020 at 5:36 AM Nikita Popov wrote: > When the constructor property promotion landed, the question of how it > interacts with attributes on promoted properties did not get fully > resolved. See https://wiki.php.net/rfc/constructor_promotion#attributes > for > what the issue is. >

[PHP-DEV] Attributes and constructor property promotion

2020-09-28 Thread Nikita Popov
Hi internals, When the constructor property promotion landed, the question of how it interacts with attributes on promoted properties did not get fully resolved. See https://wiki.php.net/rfc/constructor_promotion#attributes for what the issue is. The behavior that landed was to apply the