From fcd9b3f62b391c7c0a852572f5787241dbbc3990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 4 Mar 2022 19:34:11 +0100 Subject: [PATCH] Remove obsolete `instanceof \Exception` check in Room --- files/lib/data/room/Room.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/lib/data/room/Room.class.php b/files/lib/data/room/Room.class.php index a45307d..7cb4844 100644 --- a/files/lib/data/room/Room.class.php +++ b/files/lib/data/room/Room.class.php @@ -110,7 +110,7 @@ public function canSee(?UserProfile $user = null, ?\Exception &$reason = null): EventHandler::getInstance()->fireAction($this, 'canSee', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canSee must be a \Throwable or null.'); } @@ -147,7 +147,7 @@ public function canSeeLog(?UserProfile $user = null, ?\Exception &$reason = null EventHandler::getInstance()->fireAction($this, 'canSeeLog', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canSeeLog must be a \Throwable or null.'); } @@ -179,7 +179,7 @@ public function canJoin(?UserProfile $user = null, ?\Exception &$reason = null): EventHandler::getInstance()->fireAction($this, 'canJoin', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canJoin must be a \Throwable or null.'); } @@ -216,7 +216,7 @@ public function canWritePublicly(?UserProfile $user = null, ?\Exception &$reason EventHandler::getInstance()->fireAction($this, 'canWritePublicly', $parameters); $reason = $parameters['result']; - if (!($reason === null || $reason instanceof \Exception || $reason instanceof \Throwable)) { + if (!($reason === null || $reason instanceof \Throwable)) { throw new \DomainException('Result of canWritePublicly must be a \Throwable or null.'); }