Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Lines | 8 |
Ratio | 100 % |
Tests | 4 |
CRAP Score | 2.032 |
Changes | 0 |
1 | <?php |
||
54 | 17 | View Code Duplication | protected static function validate($order) |
55 | { |
||
56 | 17 | $order = strtolower($order); |
|
57 | 17 | if (!preg_match('/\A(asc|desc)(?:ending)?\z/', $order, $m)) { |
|
58 | throw new BadKeywordException('Order must be "asc", "ascending", "desc" or "descending"'); |
||
59 | } |
||
60 | 17 | return $m[1]; |
|
61 | } |
||
62 | |||
111 |
This check looks for function calls that miss required arguments.