Re: [PHP-DEV] Add $this return type

2024-06-25 Thread Luigi Cardamone
On Tue, Jun 25, 2024 at 2:29 AM radar3301 wrote: > I'm looking for initial feedback on the following proposal. > > Often, we have the following (fluent interface) setter method: > > public function setName(?string $name): static > { > $this->name = $name; > > return $this; > } > > I propo

Re: [PHP-DEV] [DISCUSSION] Checking uninitialized class properties

2024-05-20 Thread Luigi Cardamone
properties. Fighting the "uninitialised" is something big that we may try to discuss in another thread. We have to deal with this state and a syntax to reliably check those invalid properties will be helpful. Something like "$objectVar->property is uninitialized" will be awesome. Luigi Cardamone

Re: [PHP-DEV] [DISCUSSION] Checking uninitialized class properties

2024-05-18 Thread Luigi Cardamone
cases where you can check if the property is initialised or not and for consistency "null" should be considered a valid initialization value. Are there any downsides in adding a specific syntax to check if a property is initialized with any value? Thank you. Luigi Cardamone Backend devel

[PHP-DEV] [DISCUSSION] Checking uninitialized class properties

2024-05-17 Thread Luigi Cardamone
uage syntax like "is_initialized($dto->propA)" can be an interesting solution? Thank you in advance. Luigi Cardamone Backend developer Italy