Added NotSupportedException
This commit is contained in:
parent
731eb6561b
commit
7579d962ba
3 changed files with 15 additions and 6 deletions
10
src/NotSupportedException.php
Normal file
10
src/NotSupportedException.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Szurubooru;
|
||||
|
||||
class NotSupportedException extends \BadMethodCallException
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('Not supported');
|
||||
}
|
||||
}
|
|
@ -76,8 +76,7 @@ class PostSearchParser extends AbstractSearchParser
|
|||
$this->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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue