As an extension of PR #169 and PR #174, this PR adds support for allowing event state properties to be nullable.
At the moment, if we try to pass null into an event property that is typehinted to state like this:
class UserRequestsWithNullable extends Event
{
public function __construct(
public UserRequestState $user_request1,
public ?UserRequestState $user_request2
) {}
}
$user_request1 = UserRequestState::new();
UserRequestsWithNullable::commit(
user_request1: $user_request1,
user_request2: null,
);
It throws the following error:
So this PR fixes it by ensuring that any state properties, that allow null and are set to null, get filtered out of the list of state properties for an event.
As an extension of PR #169 and PR #174, this PR adds support for allowing event state properties to be nullable.
At the moment, if we try to pass
null
into an event property that is typehinted to state like this:It throws the following error:
So this PR fixes it by ensuring that any state properties, that allow
null
and are set tonull
, get filtered out of the list of state properties for an event.