$this->type, ]; $userIdentifier += match ($this->type) { UserIdentifierType::USER => [ "user" => $this->user, ], UserIdentifierType::THIRDPARTY => [ "medium" => $this->thirdPartyMedium, "address" => $this->thirdPartyAddress, ], UserIdentifierType::PHONE => [ "country" => $this->phoneCountry, "phone" => $this->phoneNumber, ], default => [], }; return $userIdentifier; } }