1 | <?php |
||||||
2 | |||||||
3 | /** |
||||||
4 | * @namespace |
||||||
5 | */ |
||||||
6 | |||||||
7 | namespace Application\Payments; |
||||||
8 | |||||||
9 | use Application\Options\Table as OptionsTable; |
||||||
0 ignored issues
–
show
|
|||||||
10 | use Application\Payments\Table as PaymentsTable; |
||||||
11 | use Application\Transactions\Table as TransactionsTable; |
||||||
0 ignored issues
–
show
The type
Application\Transactions\Table was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
12 | |||||||
13 | class Service |
||||||
14 | { |
||||||
15 | /** |
||||||
16 | * Add Debit record |
||||||
17 | * |
||||||
18 | * @param int $userId |
||||||
19 | * @param array $data |
||||||
20 | * |
||||||
21 | * @return \Application\Wallets\Row|bool |
||||||
0 ignored issues
–
show
The type
Application\Wallets\Row was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
22 | */ |
||||||
23 | public static function addLiqpayPayment(int $userId, array $data) |
||||||
24 | { |
||||||
25 | return Db::transaction(function () use ($userId, $data) { |
||||||
0 ignored issues
–
show
The type
Application\Payments\Db was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
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); |
||||||
0 ignored issues
–
show
The method
getWallet() does not exist on Application\Payments\Service .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
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 | }); |
||||||
50 | } |
||||||
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