Added NotSupportedException

This commit is contained in:
Marcin Kurczewski 2014-10-06 21:16:46 +02:00
parent 731eb6561b
commit 7579d962ba
3 changed files with 15 additions and 6 deletions

View file

@ -0,0 +1,10 @@
<?php
namespace Szurubooru;
class NotSupportedException extends \BadMethodCallException
{
public function __construct()
{
parent::__construct('Not supported');
}
}

View file

@ -76,8 +76,7 @@ class PostSearchParser extends AbstractSearchParser
$this->decorateFilterFromNamedToken($filter, $token); $this->decorateFilterFromNamedToken($filter, $token);
} }
else throw new \Szurubooru\NotSupportedException();
throw new \BadMethodCallException('Not supported');
} }
protected function getOrderColumn($token) protected function getOrderColumn($token)
@ -115,7 +114,7 @@ class PostSearchParser extends AbstractSearchParser
elseif ($token === 'fav_time') elseif ($token === 'fav_time')
return \Szurubooru\SearchServices\Filters\PostFilter::ORDER_LAST_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) private function addIdRequirement($filter, $token)

View file

@ -10,12 +10,12 @@ class UserSearchParser extends AbstractSearchParser
protected function decorateFilterFromToken($filter, $token) protected function decorateFilterFromToken($filter, $token)
{ {
throw new \BadMethodCallException('Not supported'); throw new \Szurubooru\NotSupportedException();
} }
protected function decorateFilterFromNamedToken($filter, $namedToken) protected function decorateFilterFromNamedToken($filter, $namedToken)
{ {
throw new \BadMethodCallException('Not supported'); throw new \Szurubooru\NotSupportedException();
} }
protected function getOrderColumn($token) protected function getOrderColumn($token)
@ -26,6 +26,6 @@ class UserSearchParser extends AbstractSearchParser
elseif ($token === 'registration_time') elseif ($token === 'registration_time')
return \Szurubooru\SearchServices\Filters\UserFilter::ORDER_REGISTRATION_TIME; return \Szurubooru\SearchServices\Filters\UserFilter::ORDER_REGISTRATION_TIME;
return null; throw new \Szurubooru\NotSupportedException();
} }
} }