Re: [RFC] [Vote] Readonly amendments
| From: | Matthew Weier O'Phinney | Date: | Tue, 24 Jan 2023 17:32:09 +0000 |
| Subject: | Re: [RFC] [Vote] Readonly amendments | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119420@lists.php.net to get a copy of this message | ||
On Tue, Jan 24, 2023 at 9:13 AM Robert Landers <landers.robert@gmail.com>
wrote:
> On Tue, Jan 24, 2023 at 3:27 PM Matthew Weier O'Phinney
> <mweierophinney@gmail.com> wrote:
> >
> > On Tue, Jan 24, 2023 at 2:55 AM Máté Kocsis <kocsismate90@gmail.com>
> wrote:
> >
> > > Hi Everyone,
> > >
> > > We've just opened the vote for the "Readonly amendments" RFC, which is
> > > going to be open for 2 weeks (until 2023-02-07).
> > >
> > > Link: https://wiki.php.net/rfc/readonly_amendments
> > > Discussion: https://externals.io/message/119007
> > >
> >
> > I missed something when reviewing previously.
> >
> > Under the Proposal 1 section is the following verbiage:
> >
> > > readonly classes can declare neither static, nor untyped properties, no
> > matter if the declaration is done directly in the class or indirectly
> via a
> > trait (https://github.com/php/php-src/issues/9285). Under this RFC,
> their
> > non-readonly child classes would support them as any other child class
> does.
> >
> > However, the example demonstrates neither static nor untyped properties..
> As
> > such, it's hard to understand what pattern you are trying to enable here.
> > Could you provide an example of a child class that uses static and/or
> > untyped properties, please? Basically trying to understand what this
> would
> > enable, and why.
>
> Mocking
>
This isn't a terribly compelling argument. Readonly classes are typically
value objects; it's rare that you will mock them as they will be used as
messages or results, and you'll end up doing assertions against them — not
mocking them.
Anything else it would enable?
--
Matthew Weier O'Phinney
mweierophinney@gmail.com
https://mwop.net/
he/him