Conditions | 4 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
1 | <?php |
||
28 | 38 | public function toString() |
|
29 | { |
||
30 | 38 | $orders = array(); |
|
31 | 38 | foreach($this->orders as $column => $direction) |
|
32 | { |
||
33 | 12 | if(! empty($column)) |
|
34 | 12 | { |
|
35 | 11 | $orders[] = $column . ' ' . $direction; |
|
36 | 11 | } |
|
37 | 38 | } |
|
38 | |||
39 | 38 | if(empty($orders)) |
|
40 | 38 | { |
|
41 | 29 | return ''; |
|
42 | } |
||
43 | |||
44 | 11 | return sprintf('ORDER BY %s', implode(', ', $orders)); |
|
45 | } |
||
46 | |||
56 |