Code Duplication    Length = 6-6 lines in 2 locations

src/Generator/Pagination.php 1 location

@@ 60-65 (lines=6) @@
57
            }
58
            // sort
59
            $pages = $pages->sortByDate();
60
            if ($sortby) {
61
                $sortMethod = sprintf('sortBy%s', ucfirst($sortby));
62
                if (method_exists($pages, $sortMethod)) {
63
                    $pages = $pages->$sortMethod();
64
                }
65
            }
66
67
            // build pagination
68
            $pagesTotal = count($pages);

src/Generator/Section.php 1 location

@@ 53-58 (lines=6) @@
50
                $pages = new PagesCollection($section, $pagesAsArray);
51
                // sort
52
                $pages = $pages->sortByDate();
53
                if ($page->getVariable('sortby')) {
54
                    $sortMethod = sprintf('sortBy%s', ucfirst($page->getVariable('sortby')));
55
                    if (method_exists($pages, $sortMethod)) {
56
                        $pages = $pages->$sortMethod();
57
                    }
58
                }
59
                // add navigation links
60
                $this->addNavigationLinks($pages);
61
                // create page for each section