Completed
Pull Request — master (#141)
by Alexander
05:06
created

CartResponse   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 82
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 1
dl 82
loc 82
ccs 9
cts 15
cp 0.6
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getItems() 4 4 1
A setItems() 5 5 1
A getDeliveryOptions() 4 4 1
A setDeliveryOptions() 5 5 1
A getPaymentMethods() 4 4 1
A setPaymentMethods() 5 5 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
namespace Yandex\Market\Partner\Models;
4
5
use Yandex\Market\Partner\Models\Items;
6
use Yandex\Market\Partner\Models\DeliveryOptions;
7
use Yandex\Common\Model;
8
9 View Code Duplication
class CartResponse extends Model
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...
10
{
11
12
    protected $items = null;
13
14
    protected $deliveryOptions = null;
15
16
    protected $paymentMethods = null;
17
18
    protected $mappingClasses = [
19
        'items' => 'Yandex\Market\Partner\Models\Items',
20
        'deliveryOptions' => 'Yandex\Market\Partner\Models\DeliveryOptions'
21
    ];
22
23
    protected $propNameMap = [];
24
25
    /**
26
     * Retrieve the items property
27
     *
28
     * @return Items|null
29
     */
30
    public function getItems()
31
    {
32
        return $this->items;
33
    }
34
35
    /**
36
     * Set the items property
37
     *
38
     * @param Items $items
39
     * @return $this
40
     */
41 1
    public function setItems($items)
42
    {
43 1
        $this->items = $items;
44 1
        return $this;
45
    }
46
47
    /**
48
     * Retrieve the deliveryOptions property
49
     *
50
     * @return DeliveryOptions|null
51
     */
52
    public function getDeliveryOptions()
53
    {
54
        return $this->deliveryOptions;
55
    }
56
57
    /**
58
     * Set the deliveryOptions property
59
     *
60
     * @param DeliveryOptions $deliveryOptions
61
     * @return $this
62
     */
63 1
    public function setDeliveryOptions($deliveryOptions)
64
    {
65 1
        $this->deliveryOptions = $deliveryOptions;
66 1
        return $this;
67
    }
68
69
    /**
70
     * Retrieve the paymentMethods property
71
     *
72
     * @return array|null
73
     */
74
    public function getPaymentMethods()
75
    {
76
        return $this->paymentMethods;
77
    }
78
79
    /**
80
     * Set the paymentMethods property
81
     *
82
     * @param array $paymentMethods
83
     * @return $this
84
     */
85 1
    public function setPaymentMethods($paymentMethods)
86
    {
87 1
        $this->paymentMethods = $paymentMethods;
88 1
        return $this;
89
    }
90
}
91