Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | final class OrderBy extends Field |
||
9 | { |
||
10 | public const ASC = 'ASC'; |
||
11 | public const DESC = 'DESC'; |
||
12 | |||
13 | private string $direction; |
||
14 | |||
15 | 6 | private function __construct(string $field, string $direction) |
|
16 | { |
||
17 | 6 | parent::__construct($field); |
|
18 | |||
19 | 6 | $this->direction = $direction; |
|
20 | 6 | } |
|
21 | |||
22 | 2 | public static function asc(string $field): self |
|
23 | { |
||
24 | 2 | return new self($field, self::ASC); |
|
25 | } |
||
26 | |||
27 | 4 | public static function desc(string $field): self |
|
30 | } |
||
31 | |||
32 | 6 | public function direction(): string |
|
35 | } |
||
36 | } |
||
37 |