@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $generatedPages = new PagesCollection(); |
26 | 26 | |
27 | - $filteredPages = $pagesCollection->filter(function (Page $page) { |
|
27 | + $filteredPages = $pagesCollection->filter(function(Page $page) { |
|
28 | 28 | return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION]); |
29 | 29 | }); |
30 | 30 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $paginatePagesCount = ceil($pagesTotal / $paginatePerPage); |
48 | 48 | for ($i = 0; $i < $paginatePagesCount; $i++) { |
49 | 49 | $pagesInPagination = new \LimitIterator($pages->getIterator(), ($i * $paginatePerPage), $paginatePerPage); |
50 | - $pagesInPagination = new PagesCollection($page->getId().'-page-'.($i+1), iterator_to_array($pagesInPagination)); |
|
50 | + $pagesInPagination = new PagesCollection($page->getId().'-page-'.($i + 1), iterator_to_array($pagesInPagination)); |
|
51 | 51 | $alteredPage = clone $page; |
52 | 52 | // first page |
53 | 53 | $firstPath = Page::slugify(sprintf('%s', $path)); |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | $alteredPage->setVariable('totalpages', $pagesTotal); |
78 | 78 | $alteredPage->setVariable('pages', $pagesInPagination); |
79 | 79 | // create links |
80 | - $pagination = ['self' => $currentPath?: 'index']; |
|
81 | - $pagination += ['first' => $firstPath?: 'index']; |
|
80 | + $pagination = ['self' => $currentPath ?: 'index']; |
|
81 | + $pagination += ['first' => $firstPath ?: 'index']; |
|
82 | 82 | if ($i == 1) { |
83 | - $pagination += ['prev' => Page::slugify($path?: 'index')]; |
|
83 | + $pagination += ['prev' => Page::slugify($path ?: 'index')]; |
|
84 | 84 | } |
85 | 85 | if ($i > 1) { |
86 | 86 | $pagination += ['prev' => Page::slugify(sprintf('%s/%s/%s', $path, $paginatePath, $i))]; |