Skip to content

Optional properties can now be initialized late

In the previous handling of constructor properties, no default values were assigned to those not provided in the constructor. This means if you tried to define it after the object was created via a setter, you'd run into an error like:

Error: Typed property DiscordMessageBuilder\WebhookMessage::$components must not be accessed before initialization

This PR fixes that, but only using constructor promotion where the property is required to have a value.

Merge request reports

Loading