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