| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public static function addLiqpayPayment(int $userId, array $data) |
||
| 24 | { |
||
| 25 | return Db::transaction(function () use ($userId, $data) { |
||
| 26 | |||
| 27 | $value = ceil($data['amount'] / OptionsTable::get('price')) * 1000; |
||
| 28 | |||
| 29 | $transaction = TransactionsTable::create(); |
||
| 30 | $transaction->userId = $userId; |
||
| 31 | $transaction->amount = $value; |
||
| 32 | $transaction->type = TransactionsTable::TYPE_DEBIT; |
||
| 33 | $transaction->save(); |
||
| 34 | |||
| 35 | $wallet = self::getWallet($userId); |
||
| 36 | $wallet->amount += $transaction->amount; |
||
| 37 | $wallet->save(); |
||
| 38 | |||
| 39 | $payment = PaymentsTable::create(); |
||
| 40 | $payment->amount = $data['amount']; |
||
| 41 | $payment->currency = $data['currency']; |
||
| 42 | $payment->provider = PaymentsTable::PROVIDER_LIQPAY; |
||
| 43 | $payment->foreignId = $data['payment_id']; |
||
| 44 | $payment->transactionId = $transaction->id; |
||
| 45 | $payment->rawData = \json_encode($data); |
||
| 46 | $payment->save(); |
||
| 47 | |||
| 48 | return $transaction; |
||
| 49 | }); |
||
| 51 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths