Conditions | 3 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function getFunctions() |
||
11 | { |
||
12 | return [ |
||
13 | new ExpressionFunction('ceil', function ($num) { |
||
14 | return sprintf('(is_numeric(%1$s) ? ceil(%1$s) : %1$s)', $num); |
||
15 | }, function ($arguments, $num) { |
||
16 | if (!is_numeric($num)) { |
||
17 | return $num; |
||
18 | } |
||
19 | |||
20 | return ceil($num); |
||
21 | }), |
||
22 | new ExpressionFunction('floor', function ($num) { |
||
23 | return sprintf('(is_numeric(%1$s) ? floor(%1$s) : %1$s)', $num); |
||
24 | }, function ($arguments, $num) { |
||
25 | if (!is_numeric($num)) { |
||
26 | return $num; |
||
27 | } |
||
28 | |||
29 | return floor($num); |
||
30 | }), |
||
34 |