Completed
Push — master ( 5c8cb6...92357d )
by Dmitry
02:05
created

OmnipayResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 20
loc 20
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTime() 4 4 1
A getPayer() 4 4 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\yandex;
12
13
use hiqdev\php\merchant\Helper;
14
15
/**
16
 * WebMoney Omnipay Response class.
17
 */
18 View Code Duplication
class OmnipayResponse extends \hiqdev\php\merchant\OmnipayResponse
0 ignored issues
show
Duplication introduced by
This class 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...
19
{
20
    /**
21
     * Get payment time.
22
     * @return string
23
     */
24
    public function getTime()
25
    {
26
        return Helper::isotime($this->getVar('datetime') . ' Europe/Moscow');
27
    }
28
29
    /**
30
     * Get payer info.
31
     * @return string
32
     */
33
    public function getPayer()
34
    {
35
        return $this->getVar('sender') ?: $this->getVar('email');
36
    }
37
}
38