$events This is a mapping from event type to power level required. * @param ?array $notifications This is a mapping from key to power level for that notifications key. * @param ?array $events This is a mapping from user_id to power level for that user. */ public function __construct( string $eventId, int $originServerTimestamp, string $roomId, string $sender, ?int $ban = 50, ?array $events = null, ?int $eventsDefault = 0, ?int $invite = 0, ?int $kick = 50, ?array $notifications = null, # TODO: https://spec.matrix.org/v1.17/client-server-api/#mroompower_levels_notifications ?int $redact = 50, ?int $stateDefault = 50, ?array $users = null, ?int $usersDefault = 0, string $stateKey = "", ?UnsignedData $unsigned = null, ) { parent::__construct( array_filter([ "ban" => $ban, "events" => $events, "events_default" => $eventsDefault, "invite" => $invite, "kick" => $kick, "notifications" => $notifications, "redact" => $redact, "state_default" => $stateDefault, "users" => $users, "users_default" => $usersDefault, ], fn ($value) => ! is_null($value)), $eventId, $originServerTimestamp, $roomId, $sender, $stateKey, EventType::ROOM_POWER_LEVELS, $unsigned, ); } }