| Total Complexity | 9 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 12 | class OrderByParser |
||
| 13 | { |
||
| 14 | /** @var array */ |
||
| 15 | private $sortableFields; |
||
| 16 | |||
| 17 | private function __construct(array $sortableFields = []) |
||
| 18 | { |
||
| 19 | $this->sortableFields = $sortableFields; |
||
| 20 | } |
||
| 21 | |||
| 22 | public static function mappedAs(array $sortableFieldsMap): self |
||
| 25 | } |
||
| 26 | |||
| 27 | public static function allowing(string ...$sortableFields): self |
||
| 28 | { |
||
| 29 | return new self(array_combine($sortableFields, $sortableFields)); |
||
|
|
|||
| 30 | } |
||
| 31 | |||
| 32 | public function parse(Sorting $sorting): string |
||
| 43 | } |
||
| 44 | |||
| 45 | private function parseSingle(Sorting $sorting): string |
||
| 56 | ); |
||
| 57 | } |
||
| 59 |