Code Duplication    Length = 6-6 lines in 2 locations

src/Generator/Pagination.php 1 location

@@ 63-68 (lines=6) @@
60
            }
61
            // sort
62
            $pages = $pages->sortByDate();
63
            if ($page->getVariable('sortby')) {
64
                $sortMethod = sprintf('sortBy%s', ucfirst($page->getVariable('sortby')));
65
                if (method_exists($pages, $sortMethod)) {
66
                    $pages = $pages->$sortMethod();
67
                }
68
            }
69
70
            // build pagination
71
            $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