Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
32 | public function parse(Sorting $sorting): string |
||
33 | { |
||
34 | if (!$sorting->isRequired()) { |
||
35 | return ''; |
||
36 | } |
||
37 | $orderBy = []; |
||
38 | while ($sorting->isRequired()) { |
||
39 | $orderBy[] = $this->parseSingle($sorting); |
||
40 | $sorting = $sorting->next(); |
||
41 | } |
||
42 | return sprintf('ORDER BY %s', implode(', ', $orderBy)); |
||
43 | } |
||
59 |