Skip to content

Commit

Permalink
Type hint with interface instead of class.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 10, 2017
1 parent fc99fd9 commit 86aec15
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Controller/Component/PaginatorComponent.php
Expand Up @@ -18,6 +18,7 @@
use Cake\Controller\ComponentRegistry;
use Cake\Datasource\Exception\PageOutOfBoundsException;
use Cake\Datasource\Paginator;
use Cake\Datasource\PaginatorInterface;
use Cake\Datasource\QueryInterface;
use Cake\Network\Exception\NotFoundException;

Expand Down Expand Up @@ -59,7 +60,7 @@ class PaginatorComponent extends Component
/**
* Datasource paginator instance.
*
* @var \Cake\Datasource\Paginator
* @var \Cake\Datasource\PaginatorInterface
*/
protected $_paginator;

Expand Down Expand Up @@ -236,10 +237,10 @@ public function mergeOptions($alias, $settings)
/**
* Set paginator instance.
*
* @param \Cake\Datasource\Paginator $paginator Paginator instance.
* @param \Cake\Datasource\PaginatorInterface $paginator Paginator instance.
* @return self
*/
public function setPaginator(Paginator $paginator)
public function setPaginator(PaginatorInterface $paginator)
{
$this->_paginator = $paginator;

Expand All @@ -249,7 +250,7 @@ public function setPaginator(Paginator $paginator)
/**
* Get paginator instance.
*
* @return \Cake\Datasource\Paginator
* @return \Cake\Datasource\PaginatorInterface
*/
public function getPaginator()
{
Expand Down Expand Up @@ -282,7 +283,7 @@ protected function _setPagingParams()
public function config($key = null, $value = null, $merge = true)
{
$return = $this->_paginator->config($key, $value, $merge);
if ($return instanceof Paginator) {
if ($return instanceof PaginatorInterface) {
$return = $this;
}

Expand Down

0 comments on commit 86aec15

Please sign in to comment.