I don't think the way it is going to be realeased is elegant solution
On Sat, Jul 17, 2021, 2:47 PM Andreas Leathley wrote:
> On 16.07.21 09:06, Nikita Popov wrote:
> > We cannot make properties readonly by default, because that would be a
> > major backwards compatibility break.
> >
> > If
On 16.07.21 09:06, Nikita Popov wrote:
We cannot make properties readonly by default, because that would be a
major backwards compatibility break.
If you're going for brevity, something you can do is omit the visibility
specifier, as it is public by default. "readonly int $prop" works.
Would
> On Jul 17, 2021, at 1:40 AM, Eugene Sidelnyk wrote:
>
> > Having a "readonly" class where the properties are read-only by default
> > makes sense to me, but maybe the better way to do it is with an attribute?
>
> We already have such an attribute provided. It is called
>
> Please don't top post. This is a bottom-post-centric list.
Can you please tell me what mailing client you use and what should I?
> if we were designing the language today we would do it very differently.
This reminds me working with legacy code in the team which says to write
the code in
> Having a "readonly" class where the properties are read-only by default
makes sense to me, but maybe the better way to do it is with an attribute?
We already have such an attribute provided. It is called [`#[Immutable]`](
> On Jul 16, 2021, at 6:12 AM, Bruce Weirdan wrote:
>
> On Fri, Jul 16, 2021 at 9:45 AM Eugene Sidelnyk wrote:
>
>> Readonly properties are really useful for DDD, where everything is going to
>> be immutable. It promotes best practices. However for people to use it,
>> syntax should be concise
On Fri, Jul 16, 2021, at 6:48 AM, Eugene Sidelnyk wrote:
> @Nikita Popov I'm not sure what you mean by saying
> this:
>
> > We're always explicit at the declaration site, it's const FOO, function
> foo, class Foo etc
>
>
> Regarding your message
>
> > Here mutability is decided by single $
@Nikita Popov I'm not sure what you mean by saying
this:
> We're always explicit at the declaration site, it's const FOO, function
foo, class Foo etc
Regarding your message
> Here mutability is decided by single $ character in the declaration,
which doesn't have a particular obvious
On Fri, Jul 16, 2021 at 9:45 AM Eugene Sidelnyk wrote:
> Readonly properties are really useful for DDD, where everything is going to
> be immutable. It promotes best practices. However for people to use it,
> syntax should be concise and brief.
If every property of the class is readonly it
On Fri, Jul 16, 2021 at 10:11 AM Eugene Sidelnyk
wrote:
> Thanks for your response!
> Anyway, I probably put it wrong by saying "by default", so let me clarify
> myself.
>
> What I really mean is omitting the dollar sign. So everything remains the
> same with ordinary properties (which are
On 16/07/2021 09:11, Eugene Sidelnyk wrote:
Thanks for your response!
Anyway, I probably put it wrong by saying "by default", so let me clarify
myself.
What I really mean is omitting the dollar sign. So everything remains the
same with ordinary properties (which are mutable), and we introduce
Le 16/07/2021 à 10:11, Eugene Sidelnyk a écrit :
Thanks for your response!
Anyway, I probably put it wrong by saying "by default", so let me clarify
myself.
What I really mean is omitting the dollar sign. So everything remains the
same with ordinary properties (which are mutable), and we
Thanks for your response!
Anyway, I probably put it wrong by saying "by default", so let me clarify
myself.
What I really mean is omitting the dollar sign. So everything remains the
same with ordinary properties (which are mutable), and we introduce
immutable (readonly) properties as another type
On Fri, Jul 16, 2021 at 8:45 AM Eugene Sidelnyk wrote:
> This is replica of github PR comments:
>
> Hi there!
> Isn't it better to simplify this a bit? I mean `readonly` keyword is really
> long to type every time we need such property. Earlier (in php7.3)
> properties were defined only with
This is replica of github PR comments:
Hi there!
Isn't it better to simplify this a bit? I mean `readonly` keyword is really
long to type every time we need such property. Earlier (in php7.3)
properties were defined only with visibility modifier. Now it is going to
become *t verbose*.
```php
15 matches
Mail list logo