DX: fix phpstan errors

This commit is contained in:
2023-02-04 00:50:58 +01:00
parent a01cc23c14
commit 856eea37ee
16 changed files with 94 additions and 120 deletions

View File

@@ -32,26 +32,26 @@ interface PaginatorInterface extends Countable
*
* @return int
*/
public function countPages();
public function countPages(): int;
/**
* get the current page.
*
* @return PageInterface
*/
public function getCurrentPage();
public function getCurrentPage(): PageInterface;
/**
* get the first result for the current page.
*
* @return int
*/
public function getCurrentPageFirstItemNumber();
public function getCurrentPageFirstItemNumber(): int;
/*
* get the number of items per page
*/
public function getItemsPerPage();
public function getItemsPerPage(): int;
/**
* get the next page.
@@ -60,7 +60,7 @@ interface PaginatorInterface extends Countable
*
* @return PageInterface
*/
public function getNextPage();
public function getNextPage(): PageInterface;
/**
* get page by his number.
@@ -69,14 +69,14 @@ interface PaginatorInterface extends Countable
*
* @throws RuntimeException if the pagination has no page with specified number
*/
public function getPage($number);
public function getPage(int $number): PageInterface;
/**
* get a generator to generate pages.
*
* @return Generator which return PageInterface elements
*/
public function getPagesGenerator();
public function getPagesGenerator(): iterable;
/**
* get the previous page.
@@ -85,35 +85,34 @@ interface PaginatorInterface extends Countable
*
* @return PageInterface
*/
public function getPreviousPage();
public function getPreviousPage(): PageInterface;
/**
* get the number of results for this paginator.
*
* @return int
*/
public function getTotalItems();
public function getTotalItems(): int;
/**
* check if the current page has a next page.
*
* @return bool
*/
public function hasNextPage();
public function hasNextPage(): bool;
/**
* check if the page with the given number exists.
*
* @param int $number
*/
public function hasPage($number);
public function hasPage($number): bool;
/**
* check if the current page has a page before.
*
* @return bool
*/
public function hasPreviousPage();
public function hasPreviousPage(): bool;
/**
* check if the given page is the current page.
@@ -122,10 +121,10 @@ interface PaginatorInterface extends Countable
*
* @return bool
*/
public function isCurrentPage(PageInterface $page);
public function isCurrentPage(PageInterface $page): bool;
/*
* set the number of items per page
*/
public function setItemsPerPage($itemsPerPage);
public function setItemsPerPage(int $itemsPerPage);
}