From 7579d962ba9971282146ada9852be00777904dcb Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Mon, 6 Oct 2014 21:16:46 +0200 Subject: [PATCH] Added NotSupportedException --- src/NotSupportedException.php | 10 ++++++++++ src/SearchServices/Parsers/PostSearchParser.php | 5 ++--- src/SearchServices/Parsers/UserSearchParser.php | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 src/NotSupportedException.php diff --git a/src/NotSupportedException.php b/src/NotSupportedException.php new file mode 100644 index 00000000..91abb1d5 --- /dev/null +++ b/src/NotSupportedException.php @@ -0,0 +1,10 @@ +decorateFilterFromNamedToken($filter, $token); } - else - throw new \BadMethodCallException('Not supported'); + throw new \Szurubooru\NotSupportedException(); } protected function getOrderColumn($token) @@ -115,7 +114,7 @@ class PostSearchParser extends AbstractSearchParser elseif ($token === 'fav_time') return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_LAST_FAV_TIME; - throw new \BadMethodCallException('Not supported'); + throw new \Szurubooru\NotSupportedException(); } private function addIdRequirement($filter, $token) diff --git a/src/SearchServices/Parsers/UserSearchParser.php b/src/SearchServices/Parsers/UserSearchParser.php index 53638fb8..cd6a6daa 100644 --- a/src/SearchServices/Parsers/UserSearchParser.php +++ b/src/SearchServices/Parsers/UserSearchParser.php @@ -10,12 +10,12 @@ class UserSearchParser extends AbstractSearchParser protected function decorateFilterFromToken($filter, $token) { - throw new \BadMethodCallException('Not supported'); + throw new \Szurubooru\NotSupportedException(); } protected function decorateFilterFromNamedToken($filter, $namedToken) { - throw new \BadMethodCallException('Not supported'); + throw new \Szurubooru\NotSupportedException(); } protected function getOrderColumn($token) @@ -26,6 +26,6 @@ class UserSearchParser extends AbstractSearchParser elseif ($token === 'registration_time') return \Szurubooru\SearchServices\Filters\UserFilter::ORDER_REGISTRATION_TIME; - return null; + throw new \Szurubooru\NotSupportedException(); } }