mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Pagination;
|
||||
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
/**
|
||||
@@ -100,28 +99,21 @@ class Paginator implements PaginatorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException if the next page does not exists
|
||||
*
|
||||
* @return \Chill\MainBundle\Pagination\Page
|
||||
* @throws \RuntimeException if the next page does not exists
|
||||
*/
|
||||
public function getNextPage(): Page
|
||||
{
|
||||
if (!$this->hasNextPage()) {
|
||||
throw new RuntimeException('this page has no next page');
|
||||
throw new \RuntimeException('this page has no next page');
|
||||
}
|
||||
|
||||
return $this->getPage($this->currentPageNumber + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return \Chill\MainBundle\Pagination\Page
|
||||
*/
|
||||
public function getPage(int $number): Page
|
||||
{
|
||||
if (!$this->hasPage($number)) {
|
||||
throw new RuntimeException("The page with number {$number} does not "
|
||||
. 'exists');
|
||||
throw new \RuntimeException("The page with number {$number} does not ".'exists');
|
||||
}
|
||||
|
||||
return new Page(
|
||||
@@ -145,14 +137,14 @@ class Paginator implements PaginatorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException if the next page does not exists
|
||||
*
|
||||
* @return \Chill\MainBundle\Pagination\Page
|
||||
*
|
||||
* @throws \RuntimeException if the next page does not exists
|
||||
*/
|
||||
public function getPreviousPage(): PageInterface
|
||||
{
|
||||
if (!$this->hasPreviousPage()) {
|
||||
throw new RuntimeException('this page has no previous page');
|
||||
throw new \RuntimeException('this page has no previous page');
|
||||
}
|
||||
|
||||
return $this->getPage($this->currentPageNumber - 1);
|
||||
@@ -163,9 +155,6 @@ class Paginator implements PaginatorInterface
|
||||
return $this->totalItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasNextPage(): bool
|
||||
{
|
||||
return $this->hasPage($this->currentPageNumber + 1);
|
||||
@@ -181,9 +170,6 @@ class Paginator implements PaginatorInterface
|
||||
&& $this->countPages() >= $number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPreviousPage(): bool
|
||||
{
|
||||
return $this->hasPage($this->currentPageNumber - 1);
|
||||
|
Reference in New Issue
Block a user