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

@@ 47-52 (lines=6) @@
44
                $pages = new PagesCollection($section, $pagesAsArray);
45
                // sort
46
                $pages = $pages->sortByDate();
47
                if ($page->getVariable('sortby')) {
48
                    $sortMethod = sprintf('sortBy%s', ucfirst($page->getVariable('sortby')));
49
                    if (method_exists($pages, $sortMethod)) {
50
                        $pages = $pages->$sortMethod();
51
                    }
52
                }
53
                // add navigation links
54
                $this->addNavigationLinks($pages);
55
                // create page for each section