| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | final class Sort |
||
| 19 | { |
||
| 20 | const ASC = 'asc'; |
||
| 21 | const DESC = 'desc'; |
||
| 22 | |||
| 23 | /** @var string */ |
||
| 24 | private $sort; |
||
| 25 | |||
| 26 | private function __construct(string $sort) |
||
| 27 | { |
||
| 28 | Assertion::choice($sort, [self::ASC, self::DESC], 'Sort option incorrect'); |
||
| 29 | |||
| 30 | $this->sort = $sort; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function __toString(): string |
||
| 36 | } |
||
| 37 | |||
| 38 | public static function fromString(string $sort): self |
||
| 41 | } |
||
| 42 | } |
||
| 43 |