Completed
Push — master ( 8a354a...1383d1 )
by Dmitry
12:48
created

PaymentMethodsProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPaymentMethods() 0 10 1
1
<?php
2
3
4
namespace hipanel\modules\finance\providers;
5
6
7
use hiqdev\yii2\cart\PaymentMethodsProviderInterface;
8
use Yii;
9
10
/**
11
 * Class PaymentMethodsProvider
12
 * @package hipanel\modules\finance\providers
13
 */
14
class PaymentMethodsProvider implements PaymentMethodsProviderInterface
15
{
16
    /**
17
     * @inheritDoc
18
     */
19
    public function getPaymentMethods()
20
    {
21
        $merchants = Yii::$app->getModule('merchant')->getPurchaseRequestCollection(
22
            new \hiqdev\yii2\merchant\models\DepositRequest(['amount' => 5])
23
        )->getItems();
24
25
        return Yii::$app->getView()->renderFile(dirname(__DIR__) . '/views/cart/payment-methods.php', [
26
            'merchants' => $merchants,
27
        ]);
28
    }
29
}
30