Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function format($price, $currencyCode) |
||
25 | { |
||
26 | foreach ($this->currencies as $currency) { |
||
27 | if ($currency['Code'] == $currencyCode) { |
||
28 | if ($currency['SymbolOnLeft'] == 'true') { |
||
29 | return $currency['Symbol'] . |
||
30 | number_format( |
||
31 | $price, |
||
32 | 2, |
||
33 | $currency['DecimalSeparator'], |
||
34 | $currency['ThousandsSeparator'] |
||
35 | ); |
||
36 | } |
||
37 | |||
38 | return number_format( |
||
39 | $price, |
||
40 | 2, |
||
41 | $currency['DecimalSeparator'], |
||
42 | $currency['ThousandsSeparator'] |
||
43 | ) . $currency['Symbol']; |
||
44 | } |
||
45 | } |
||
46 | } |
||
47 | |||
60 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.