Completed
Push — master ( 184d52...247cd7 )
by Andrii
02:13
created

OmnipayRequest::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Generalization over Omnipay and Payum
4
 *
5
 * @link      https://github.com/hiqdev/php-merchant
6
 * @package   php-merchant
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\merchant;
12
13
class OmnipayRequest extends AbstractRequest
14
{
15
    /**
16
     * @var \Omnipay\Common\Message\AbstractRequest Omnipay Request object
17
     */
18
    protected $_worker;
19
20
    /**
21
     * @var OmnipayMerchant
22
     */
23
    public $merchant;
24
25
    /**
26
     * @return \Omnipay\Common\Message\AbstractRequest
27
     */
28 View Code Duplication
    public function getWorker()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    {
30
        if ($this->_worker === null) {
31
            $this->_worker = $this->merchant->getWorker()->{$this->getType()}($this->getData());
32
        }
33
34
        return $this->_worker;
35
    }
36
37 1
    public function getData()
38
    {
39 1
        $this->data['sum'] = Helper::formatMoney($this->data['sum']);
40 1
        $this->data['amount'] = Helper::formatMoney($this->data['amount']);
41
42 1
        return $this->data;
43
    }
44
}
45