On Thu, Nov 26, 2020 at 10:43 AM Pierre R. <pierre-...@processus.org> wrote:
> Le 26/11/2020 à 17:30, David Rodrigues a écrit :
> > It is just an idea to discuss. PHP 8 now supports parameter promotion
via
> > constructor. Could this idea also work for common methods?
> >
> > public function setAge(private int $age) {}
> > ===
> > private int $age;
> > public function setAge(int $age) { $this->age = $age; }
>
> It sounds weird for me,

Same.  I'd also add that for solving this problem (boilerplate accessors),
I'd much rather see us adopt C# like accessor methods and/or offer
something like the expressive methods that Larry suggested a couple weeks
ago.

Both of those have a more generalized path to addressing this, IMO.

-Sara

Reply via email to