Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fixes error in Paginator (Exception)
Browse files Browse the repository at this point in the history
Why Paginator uses View Exception?
  • Loading branch information
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ protected function _createPages($scrollingStyle = null)
*
* @param string $scrollingStyle
* @return \Zend\Paginator\ScrollingStyle
* @throws Exception\InvalidArgumentException
*/
protected function _loadScrollingStyle($scrollingStyle = null)
{
Expand All @@ -1014,8 +1015,9 @@ protected function _loadScrollingStyle($scrollingStyle = null)
switch (strtolower(gettype($scrollingStyle))) {
case 'object':
if (!$scrollingStyle instanceof ScrollingStyle) {
throw new View\Exception('Scrolling style must implement ' .
'Zend_Paginator_ScrollingStyle_Interface');
throw new Exception\InvalidArgumentException(
'Scrolling style must implement Zend_Paginator_ScrollingStyle_Interface'
);
}

return $scrollingStyle;
Expand All @@ -1027,8 +1029,10 @@ protected function _loadScrollingStyle($scrollingStyle = null)
// Fall through to default case

default:
throw new View\Exception('Scrolling style must be a class ' .
'name or object implementing Zend\Paginator\ScrollingStyle');
throw new Exception\InvalidArgumentException(
'Scrolling style must be a class ' .
'name or object implementing Zend\Paginator\ScrollingStyle'
);
}
}
}

0 comments on commit 198a3b9

Please sign in to comment.