Total Complexity | 6 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class OrderBy extends AbstractOrderBy implements ExprInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | private $fields; |
||
13 | |||
14 | /** |
||
15 | * @var Order |
||
16 | */ |
||
17 | private $order; |
||
18 | |||
19 | /** |
||
20 | * @var Strategy |
||
21 | */ |
||
22 | private $strategy; |
||
23 | |||
24 | 2 | public function __construct( |
|
25 | array $fields, |
||
26 | Order $order = null, |
||
27 | Strategy $strategy = null |
||
28 | ) { |
||
29 | 2 | $this->fields = $fields; |
|
30 | 2 | $this->order = null === $order ? Order::ASC() : $order; |
|
31 | 2 | $this->strategy = null === $strategy ? Strategy::NULLS_FIRST() : $strategy; |
|
32 | 2 | } |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 4 | protected function getFields(): array |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 4 | protected function getOrder(): Order |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 4 | protected function getStrategy(): Strategy |
|
56 | } |
||
57 | } |
||
58 |