| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 6 | public function init() |
|
| 41 | { |
||
| 42 | 6 | $currency = (int)$this->body['currency']; |
|
| 43 | 6 | $alphaCurrency = AltaPay\alphaCurrencyFromNumeric($currency); |
|
| 44 | |||
| 45 | 6 | $this->shopOrderId = $this->body['shop_orderid']; |
|
| 46 | 6 | $this->amount = AltaPay\createMoneyFromFloat($alphaCurrency, (float)$this->body['amount']); |
|
| 47 | 6 | $this->currency = $currency; |
|
| 48 | 6 | $this->language = $this->body['language']; |
|
| 49 | 6 | $this->embeddedWindow = (int)($this->body['embedded_window'] === 1); |
|
|
|
|||
| 50 | 6 | } |
|
| 51 | |||
| 99 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.