Code Duplication    Length = 12-12 lines in 2 locations

src/Extensions/CommentsExtension.php 1 location

@@ 302-313 (lines=12) @@
299
     *
300
     * @return PaginatedList
301
     */
302
    public function PagedComments()
303
    {
304
        $list = $this->Comments();
305
306
        // Add pagination
307
        $list = new PaginatedList($list, Controller::curr()->getRequest());
308
        $list->setPaginationGetVar('commentsstart' . $this->owner->ID);
309
        $list->setPageLength($this->owner->getCommentsOption('comments_per_page'));
310
311
        $this->owner->extend('updatePagedComments', $list);
312
        return $list;
313
    }
314
315
    /**
316
     * Determine if comments are enabled for this instance

src/Model/Comment.php 1 location

@@ 843-854 (lines=12) @@
840
     *
841
     * @return PaginatedList
842
     */
843
    public function PagedReplies()
844
    {
845
        $list = $this->Replies();
846
847
        // Add pagination
848
        $list = new PaginatedList($list, Controller::curr()->getRequest());
849
        $list->setPaginationGetVar('repliesstart' . $this->ID);
850
        $list->setPageLength($this->getOption('comments_per_page'));
851
852
        $this->extend('updatePagedReplies', $list);
853
        return $list;
854
    }
855
856
    /**
857
     * Generate a reply form for this comment