diff --git a/src/Adapter.php b/src/Adapter.php deleted file mode 100644 index 1c640ee..0000000 --- a/src/Adapter.php +++ /dev/null @@ -1,42 +0,0 @@ -getPaginatorAdapter()); } @@ -377,19 +369,19 @@ public static function getScrollingStyleBroker() /** * Constructor. * - * @param Adapter|AdapterAggregate $adapter + * @param AdapterInterface|AdapterAggregateInterface $adapter * @throws Exception\InvalidArgumentException */ public function __construct($adapter) { - if ($adapter instanceof Adapter) { + if ($adapter instanceof AdapterInterface) { $this->_adapter = $adapter; - } else if ($adapter instanceof AdapterAggregate) { + } else if ($adapter instanceof AdapterAggregateInterface) { $this->_adapter = $adapter->getPaginatorAdapter(); } else { throw new Exception\InvalidArgumentException( - 'Zend\Paginator\Paginator only accepts instances of the type ' . - 'Zend\Paginator\Adapter or Zend\Paginator\AdapterAggregate.' + 'Zend_Paginator only accepts instances of the type ' . + 'Zend\Paginator\Adapter\AdapterInterface or Zend\Paginator\AdapterAggregateInterface.' ); } @@ -518,7 +510,7 @@ public function getAbsoluteItemNumber($relativeItemNumber, $pageNumber = null) /** * Returns the adapter. * - * @return Adapter + * @return AdapterInterface */ public function getAdapter() { @@ -1042,7 +1034,7 @@ protected function _createPages($scrollingStyle = null) * Loads a scrolling style. * * @param string $scrollingStyle - * @return ScrollingStyle + * @return ScrollingStyleInterface * @throws Exception\InvalidArgumentException */ protected function _loadScrollingStyle($scrollingStyle = null) @@ -1053,9 +1045,9 @@ protected function _loadScrollingStyle($scrollingStyle = null) switch (strtolower(gettype($scrollingStyle))) { case 'object': - if (!$scrollingStyle instanceof ScrollingStyle) { + if (!$scrollingStyle instanceof ScrollingStyleInterface) { throw new Exception\InvalidArgumentException( - 'Scrolling style must implement Zend\Paginator\ScrollingStyle' + 'Scrolling style must implement Zend\Paginator\ScrollingStyle\ScrollingStyleInterface' ); } @@ -1070,7 +1062,7 @@ protected function _loadScrollingStyle($scrollingStyle = null) default: throw new Exception\InvalidArgumentException( 'Scrolling style must be a class ' . - 'name or object implementing Zend\Paginator\ScrollingStyle' + 'name or object implementing Zend\Paginator\ScrollingStyle\ScrollingStyleInterface' ); } } diff --git a/src/ScrollingStyle.php b/src/ScrollingStyle.php deleted file mode 100644 index 88dc25e..0000000 --- a/src/ScrollingStyle.php +++ /dev/null @@ -1,39 +0,0 @@ -getPagesInRange(1, $paginator->count()); } diff --git a/src/ScrollingStyle/Elastic.php b/src/ScrollingStyle/Elastic.php index 5fd97b4..3809a9d 100644 --- a/src/ScrollingStyle/Elastic.php +++ b/src/ScrollingStyle/Elastic.php @@ -1,26 +1,16 @@ getPageRange(); $pageNumber = $paginator->getCurrentPageNumber(); diff --git a/src/ScrollingStyle/Jumping.php b/src/ScrollingStyle/Jumping.php index 8a71892..6bfbe6c 100644 --- a/src/ScrollingStyle/Jumping.php +++ b/src/ScrollingStyle/Jumping.php @@ -1,27 +1,16 @@ getPageRange(); $pageNumber = $paginator->getCurrentPageNumber(); diff --git a/src/ScrollingStyle/ScrollingStyleInterface.php b/src/ScrollingStyle/ScrollingStyleInterface.php new file mode 100644 index 0000000..95375c7 --- /dev/null +++ b/src/ScrollingStyle/ScrollingStyleInterface.php @@ -0,0 +1,31 @@ +getPageRange(); diff --git a/src/ScrollingStyleBroker.php b/src/ScrollingStyleBroker.php index 3afcf20..eb7770b 100644 --- a/src/ScrollingStyleBroker.php +++ b/src/ScrollingStyleBroker.php @@ -1,26 +1,17 @@ setExpectedException('Zend\Paginator\Exception'); + $this->setExpectedException('Zend\Paginator\Exception\ExceptionInterface'); new Paginator\Paginator(array()); } @@ -804,7 +804,7 @@ public function testArrayAccessInClassSerializableLimitIterator() } } -class TestArrayAggregate implements Paginator\AdapterAggregate +class TestArrayAggregate implements Paginator\AdapterAggregateInterface { public function getPaginatorAdapter() { diff --git a/test/TestAsset/TestAdapter.php b/test/TestAsset/TestAdapter.php index 955ba5a..4e427f0 100644 --- a/test/TestAsset/TestAdapter.php +++ b/test/TestAsset/TestAdapter.php @@ -28,7 +28,7 @@ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class TestAdapter extends \ArrayObject implements \Zend\Paginator\Adapter +class TestAdapter extends \ArrayObject implements \Zend\Paginator\Adapter\AdapterInterface { public function count() {