Completed
Pull Request — development (#82)
by Mario
03:01
created

AmazonPay   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 101
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 12
lcom 0
cbo 1
dl 101
loc 101
c 0
b 0
f 0
rs 10

12 Methods

Rating   Name   Duplication   Size   Complexity  
A setActive() 4 4 1
A getActive() 4 4 1
A setAuthorization() 4 4 1
A getAuthorization() 4 4 1
A setCountries() 4 4 1
A getCountries() 4 4 1
A setMode() 4 4 1
A getMode() 4 4 1
A setNewOrderStatus() 4 4 1
A getNewOrderStatus() 4 4 1
A getClearingType() 4 4 1
A getKey() 4 4 1

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
 *
4
 * NOTICE OF LICENSE
5
 *
6
 * This source file is subject to the GNU General Public License (GPL 3)
7
 * that is bundled with this package in the file LICENSE.txt
8
 *
9
 * DISCLAIMER
10
 *
11
 * Do not edit or add to this file if you wish to upgrade Payone to newer
12
 * versions in the future. If you wish to customize Payone for your
13
 * needs please refer to http://www.payone.de for more information.
14
 *
15
 * @category        Payone
16
 * @package         Payone_Settings
17
 * @subpackage      Data
18
 * @copyright       Copyright (c) 2017 <[email protected]> - www.fatchip.de
19
 * @author          FATCHIP GmbH <[email protected]>
20
 * @license         <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
 * @link            http://www.fatchip.de
22
 */
23 View Code Duplication
class Payone_Settings_Data_ConfigFile_PaymentMethod_AmazonPay
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...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
24
    extends Payone_Settings_Data_ConfigFile_PaymentMethod_Abstract
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
Coding Style introduced by
Expected 0 spaces between "Payone_Settings_Data_ConfigFile_PaymentMethod_Abstract" and comma; 1 found
Loading history...
25
    implements Payone_Settings_Data_ConfigFile_Interface
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
26
{
27
    /** @var string */
28
    protected $key = Payone_Enum_ClearingType::AMAZONPAY;
29
    /** @var string */
30
    protected $active = '';
31
    /** @var string */
32
    protected $newOrderStatus = '';
33
    /** @var string */
34
    protected $countries = '';
35
    /** @var string */
36
    protected $authorization = '';
37
    /** @var string */
38
    protected $mode = '';
39
    /**
40
     * @param string $active
41
     */
42
    public function setActive($active)
43
    {
44
        $this->active = $active;
45
    }
46
    /**
47
     * @return string
48
     */
49
    public function getActive()
50
    {
51
        return $this->active;
52
    }
53
    /**
54
     * @param string $authorization
55
     */
56
    public function setAuthorization($authorization)
57
    {
58
        $this->authorization = $authorization;
59
    }
60
    /**
61
     * @return string
62
     */
63
    public function getAuthorization()
64
    {
65
        return $this->authorization;
66
    }
67
    /**
68
     * @param string $countries
69
     */
70
    public function setCountries($countries)
71
    {
72
        $this->countries = $countries;
73
    }
74
    /**
75
     * @return string
76
     */
77
    public function getCountries()
78
    {
79
        return $this->countries;
80
    }
81
    /**
82
     * @param string $mode
83
     */
84
    public function setMode($mode)
85
    {
86
        $this->mode = $mode;
87
    }
88
    /**
89
     * @return string
90
     */
91
    public function getMode()
92
    {
93
        return $this->mode;
94
    }
95
    /**
96
     * @param string $newOrderStatus
97
     */
98
    public function setNewOrderStatus($newOrderStatus)
99
    {
100
        $this->newOrderStatus = $newOrderStatus;
101
    }
102
    /**
103
     * @return string
104
     */
105
    public function getNewOrderStatus()
106
    {
107
        return $this->newOrderStatus;
108
    }
109
    /**
110
     * @return string
111
     */
112
    public function getClearingType()
113
    {
114
        return $this->key;
115
    }
116
    /**
117
     * @return string
118
     */
119
    public function getKey()
120
    {
121
        return $this->key;
122
    }
123
}
124