1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-21 21:30:08 +00:00

Remove obsolete instanceof \Exception check in Room

This commit is contained in:
Tim Düsterhus 2022-03-04 19:34:11 +01:00
parent aed4a71643
commit fcd9b3f62b
Signed by: TimWolla
GPG Key ID: 8FF75566094168AF

View File

@ -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.');
}