diff --git a/src/Helper/Processor.php b/src/Helper/Processor.php index 22b8310..b5f1ba9 100644 --- a/src/Helper/Processor.php +++ b/src/Helper/Processor.php @@ -28,9 +28,9 @@ public function __construct(UrlGeneratorInterface $router, TranslatorInterface $ /** * Generates pagination template data. * - * @param SlidingPaginationInterface $pagination - * @param array $queryParams - * @param array $viewParams + * @param SlidingPaginationInterface $pagination + * @param array $queryParams + * @param array $viewParams * * @return array */ @@ -57,11 +57,11 @@ public function render(SlidingPaginationInterface $pagination, array $queryParam * * $key examples: "article.title" or "['article.title', 'article.subtitle']" * - * @param SlidingPaginationInterface $pagination - * @param string|array $title - * @param string|array $key - * @param array $options - * @param array $params + * @param SlidingPaginationInterface $pagination + * @param string|array $title + * @param string|array $key + * @param array $options + * @param array $params * * @return array */ @@ -156,10 +156,10 @@ public function sortable(SlidingPaginationInterface $pagination, $title, $key, a * * $key example: "article.title" * - * @param SlidingPaginationInterface $pagination - * @param array $fields - * @param array $options - * @param array $params + * @param SlidingPaginationInterface $pagination + * @param array $fields + * @param array $options + * @param array $params * * @return array */ diff --git a/src/Pagination/SlidingPagination.php b/src/Pagination/SlidingPagination.php index e59b5dd..9050af6 100644 --- a/src/Pagination/SlidingPagination.php +++ b/src/Pagination/SlidingPagination.php @@ -4,6 +4,14 @@ use Knp\Component\Pager\Pagination\AbstractPagination; +/** + * @template TKey + * @template TValue + * + * @template-extends AbstractPagination + * + * @template-implements SlidingPaginationInterface + */ final class SlidingPagination extends AbstractPagination implements SlidingPaginationInterface { private ?string $route = null; diff --git a/src/Pagination/SlidingPaginationInterface.php b/src/Pagination/SlidingPaginationInterface.php index 29594c4..4631d58 100644 --- a/src/Pagination/SlidingPaginationInterface.php +++ b/src/Pagination/SlidingPaginationInterface.php @@ -4,6 +4,12 @@ use Knp\Component\Pager\Pagination\PaginationInterface; +/** + * @template TKey + * @template TValue + * + * @template-extends PaginationInterface + */ interface SlidingPaginationInterface extends PaginationInterface { public function getRoute(): ?string; diff --git a/src/Templating/PaginationHelper.php b/src/Templating/PaginationHelper.php index 6d38b95..e7c25ba 100644 --- a/src/Templating/PaginationHelper.php +++ b/src/Templating/PaginationHelper.php @@ -29,9 +29,9 @@ public function __construct(Processor $processor, PhpEngine $templating) /** * Renders the pagination template. * - * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination - * @param array $queryParams - * @param array $viewParams + * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination + * @param array $queryParams + * @param array $viewParams */ public function render(SlidingPaginationInterface $pagination, ?string $template = null, array $queryParams = [], array $viewParams = []): string { @@ -49,10 +49,10 @@ public function render(SlidingPaginationInterface $pagination, ?string $template * * $key example: "article.title" * - * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination - * @param string|array $key - * @param array $options - * @param array $params + * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination + * @param string|array $key + * @param array $options + * @param array $params */ public function sortable(SlidingPaginationInterface $pagination, string $title, $key, array $options = [], array $params = [], ?string $template = null): string { @@ -70,10 +70,10 @@ public function sortable(SlidingPaginationInterface $pagination, string $title, * * $key example: "article.title" * - * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination - * @param array $fields - * @param array $options - * @param array $params + * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination + * @param array $fields + * @param array $options + * @param array $params */ public function filter(SlidingPaginationInterface $pagination, array $fields, array $options = [], array $params = [], ?string $template = null): string { diff --git a/src/Twig/Extension/PaginationExtension.php b/src/Twig/Extension/PaginationExtension.php index 73edbdf..57ff7cb 100644 --- a/src/Twig/Extension/PaginationExtension.php +++ b/src/Twig/Extension/PaginationExtension.php @@ -29,9 +29,9 @@ public function getFunctions(): array /** * Renders the pagination template. * - * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination - * @param array $queryParams - * @param array $viewParams + * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination + * @param array $queryParams + * @param array $viewParams */ public function render(Environment $env, SlidingPaginationInterface $pagination, ?string $template = null, ?array $queryParams = [], ?array $viewParams = []): string { @@ -49,10 +49,10 @@ public function render(Environment $env, SlidingPaginationInterface $pagination, * * $key example: "article.title" * - * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination - * @param string|array $key - * @param array $options - * @param array $params + * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination + * @param string|array $key + * @param array $options + * @param array $params */ public function sortable(Environment $env, SlidingPaginationInterface $pagination, string $title, $key, array $options = [], array $params = [], ?string $template = null): string { @@ -70,10 +70,10 @@ public function sortable(Environment $env, SlidingPaginationInterface $paginatio * * $key example: "article.title" * - * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination - * @param array $fields - * @param array $options - * @param array|null $params + * @param \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination $pagination + * @param array $fields + * @param array $options + * @param array|null $params */ public function filter(Environment $env, SlidingPaginationInterface $pagination, array $fields, ?array $options = [], ?array $params = [], ?string $template = null): string {