From bbb96496363efe074fe5f1266f391cabd2480c03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 14 Jun 2016 22:37:24 +0200 Subject: [PATCH] Throw LogicException in places that should be unreachable --- .../lib/system/request/route/LookupRequestRoute.class.php | 6 +++--- .../UserProfileCommentLikeUserNotificationEvent.class.php | 2 +- ...rofileCommentResponseLikeUserNotificationEvent.class.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php b/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php index 6776f49583..4789bc1115 100644 --- a/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php @@ -100,15 +100,15 @@ class LookupRequestRoute implements IRequestRoute { * @inheritDoc */ public function setIsACP($isACP) { - // lookups are not supported for ACP requests + throw new \BadMethodCallException('lookups are not supported for ACP requests'); } /** * @inheritDoc - * @throws SystemException + * @throws \BadMethodCallException */ public function buildLink(array $components) { - throw new SystemException('LookupRequestRoute cannot build links, please verify capabilities by calling canHandle() first.'); + throw new \BadMethodCallException('LookupRequestRoute cannot build links, please verify capabilities by calling canHandle() first.'); } /** diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php index 581e97a542..8a7129636d 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php @@ -73,7 +73,7 @@ class UserProfileCommentLikeUserNotificationEvent extends AbstractSharedUserNoti * @inheritDoc */ public function getEmailMessage($notificationType = 'instant') { - // not supported + throw new \LogicException('Unreachable'); } /** diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php index 980375f15f..32a8327547 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php @@ -78,7 +78,7 @@ class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractShared * @inheritDoc */ public function getEmailMessage($notificationType = 'instant') { - // not supported + throw new \LogicException('Unreachable'); } /** -- 2.20.1