diff --git a/models/Message.php b/models/Message.php index 4b6d78c8..93b71b99 100644 --- a/models/Message.php +++ b/models/Message.php @@ -281,11 +281,11 @@ public function unpin($userId = null) * * If it's the last user, the whole message will be deleted. * - * @param int $userId + * @param int|null $userId * @throws \Throwable * @throws \yii\db\StaleObjectException */ - public function leave($userId) + public function leave($userId = null) { $userMessage = $this->getUserMessage($userId); if (!$userMessage) {