mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -22,80 +22,43 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
class Paginator implements PaginatorInterface
|
||||
{
|
||||
/**
|
||||
* The number of the current page.
|
||||
*
|
||||
* @var int
|
||||
* @param string[] $routeParameters
|
||||
*/
|
||||
protected int $currentPageNumber;
|
||||
|
||||
/**
|
||||
* the number of items on a single page.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected int $itemPerPage;
|
||||
|
||||
/**
|
||||
* the key in the GET parameter to indicate the number of item per page.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $itemPerPageKey;
|
||||
|
||||
/**
|
||||
* the key in the GET parameter to indicate the page number in
|
||||
* generated routes.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $pageKey;
|
||||
|
||||
/**
|
||||
* the route of the pages.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $route;
|
||||
|
||||
/**
|
||||
* the parameters of the route.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected array $routeParameters;
|
||||
|
||||
/**
|
||||
* The number of total items.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected int $totalItems;
|
||||
|
||||
/**
|
||||
* the generator for url.
|
||||
*
|
||||
* @var UrlGeneratorInterface
|
||||
*/
|
||||
protected UrlGeneratorInterface $urlGenerator;
|
||||
|
||||
public function __construct(
|
||||
int $totalItems,
|
||||
int $itemPerPage,
|
||||
int $currentPageNumber,
|
||||
string $route,
|
||||
array $routeParameters,
|
||||
UrlGeneratorInterface $urlGenerator,
|
||||
string $pageKey,
|
||||
string $itemPerPageKey
|
||||
/**
|
||||
* The number of total items.
|
||||
*/
|
||||
protected int $totalItems,
|
||||
/**
|
||||
* the number of items on a single page.
|
||||
*/
|
||||
protected int $itemPerPage,
|
||||
/**
|
||||
* The number of the current page.
|
||||
*/
|
||||
protected int $currentPageNumber,
|
||||
/**
|
||||
* the route of the pages.
|
||||
*/
|
||||
protected string $route,
|
||||
/**
|
||||
* the parameters of the route.
|
||||
*/
|
||||
protected array $routeParameters,
|
||||
/**
|
||||
* the generator for url.
|
||||
*/
|
||||
protected UrlGeneratorInterface $urlGenerator,
|
||||
/**
|
||||
* the key in the GET parameter to indicate the page number in
|
||||
* generated routes.
|
||||
*/
|
||||
protected string $pageKey,
|
||||
/**
|
||||
* the key in the GET parameter to indicate the number of item per page.
|
||||
*/
|
||||
protected string $itemPerPageKey
|
||||
) {
|
||||
$this->totalItems = $totalItems;
|
||||
$this->itemPerPage = $itemPerPage;
|
||||
$this->currentPageNumber = $currentPageNumber;
|
||||
$this->route = $route;
|
||||
$this->routeParameters = $routeParameters;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
$this->pageKey = $pageKey;
|
||||
$this->itemPerPageKey = $itemPerPageKey;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
|
Reference in New Issue
Block a user