FakeMerchant   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getWorker() 0 12 2
1
<?php
2
/**
3
 * Yii2 extension for payment processing with Omnipay, Payum and more later.
4
 *
5
 * @link      https://github.com/hiqdev/yii2-merchant
6
 * @package   yii2-merchant
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\yii2\merchant\tests\unit;
12
13
use Yii;
14
15
class FakeMerchant extends \hiqdev\php\merchant\AbstractMerchant
16
{
17
    public $requestClass = 'hiqdev\yii2\merchant\tests\unit\FakeRequest';
18
19
    public $responseClass = 'hiqdev\yii2\merchant\tests\unit\FakeResponse';
20
21
    /**
22
     * Fake Gateway object.
23
     */
24
    protected $_worker;
25
26
    public function getWorker()
27
    {
28
        if ($this->_worker === null) {
29
            $this->_worker = Yii::createObject([
30
                'class'   => FakeGateway::class,
31
                'gateway' => $this->gateway,
32
                'data'    => $this->data,
33
            ]);
34
        }
35
36
        return $this->_worker;
37
    }
38
}
39