Passed
Pull Request — master (#93)
by Alexander
12:07
created

CommentRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 4
c 1
b 0
f 1
dl 0
loc 11
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSort() 0 3 1
A getReader() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Blog\Comment;
6
7
use Cycle\ORM\Select;
8
use Yiisoft\Data\Reader\Sort;
9
10
final class CommentRepository extends Select\Repository
11
{
12
    public function getReader(): CommentFeedReader
13
    {
14
        return (new CommentFeedReader($this->select()))
15
            ->withSort($this->getSort());
16
    }
17
18
    private function getSort(): Sort
19
    {
20
        return (new Sort([]))->withOrder(['id' => 'asc']);
21
    }
22
}
23