Skip to content

Commit d07aa84

Browse files
committed
fix typing
1 parent e7250c1 commit d07aa84

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/BasicEntities/Controller/BookController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function book(string $slug): Response
5656

5757
public function list(Request $request): Response
5858
{
59-
$page = $request->get('page', 1);
59+
$page = (int) $request->get('page', 1);
6060
$model = $this->service->getBooksListViewModel($page);
6161

6262
return $this->renderer->renderResponse(

src/BasicEntities/ViewModel/BooksListViewModel.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,27 @@
1818

1919
class BooksListViewModel
2020
{
21-
/** @var SlidingPaginationInterface<Book> */
21+
/**
22+
* @phpstan-var SlidingPaginationInterface<Book>
23+
* @psalm-var SlidingPaginationInterface
24+
*/
2225
protected $pagination;
2326

2427
/** @var array<mixed> */
2528
protected $paginationData;
2629

27-
/** @return SlidingPaginationInterface<Book>|null */
30+
/** @phpstan-return SlidingPaginationInterface<Book>|null
31+
* @psalm-return SlidingPaginationInterface|null
32+
*/
2833
public function getPagination(): ?SlidingPaginationInterface
2934
{
3035
return $this->pagination;
3136
}
3237

3338
/**
34-
* @param SlidingPaginationInterface<Book> $pagination */
39+
* @phpstan-param SlidingPaginationInterface<Book> $pagination
40+
* @psalm-param SlidingPaginationInterface $pagination
41+
* */
3542
public function setPagination(SlidingPaginationInterface &$pagination): self
3643
{
3744
$this->pagination = $pagination;

src/Resources/views/BasicEntities/book-list.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
{% for book in model.pagination.items %}
55
<p>{{ book.title }}</p>
66
{% endfor %}
7+
{{ knp_pagination_render(model.pagination) }}
78
{% endblock content %}

0 commit comments

Comments
 (0)