RequestData   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 111
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 7
c 3
b 0
f 0
lcom 0
cbo 1
dl 111
loc 111
ccs 18
cts 18
cp 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A getSubscriptionId() 4 4 1
A setSubscriptionId() 6 6 1
A getSubscriptionStart() 4 4 1
A setSubscriptionStart() 6 6 1
A getSubscriptionEnd() 4 4 1
A setSubscriptionEnd() 6 6 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 Speicher210\Fastbill\Api\Service\Subscription\GetUsageData;
4
5
use JMS\Serializer\Annotation as JMS;
6
use Speicher210\Fastbill\Api\AbstractRequestData;
7
8
/**
9
 * The request data for getting usage data for a subscription.
10
 */
11 View Code Duplication
final class RequestData extends AbstractRequestData
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...
12
{
13
    /**
14
     * The subscription ID.
15
     *
16
     * @var integer
17
     *
18
     * @JMS\Type("integer")
19
     * @JMS\SerializedName("SUBSCRIPTION_ID")
20
     */
21
    protected $subscriptionId;
22
23
    /**
24
     * The subscription start.
25
     *
26
     * @var \DateTime
27
     *
28
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
29
     * @JMS\SerializedName("START")
30
     */
31
    protected $subscriptionStart;
32
33
    /**
34
     * The subscription end.
35
     *
36
     * @var \DateTime
37
     *
38
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
39
     * @JMS\SerializedName("END")
40
     */
41
    protected $subscriptionEnd;
42
43
    /**
44
     * Constructor.
45
     *
46
     * @param integer $subscriptionId The subscription ID.
47
     */
48 3
    public function __construct($subscriptionId)
49
    {
50 3
        $this->setSubscriptionId($subscriptionId);
51 3
    }
52
53
    /**
54
     * Get the subscription ID.
55
     *
56
     * @return integer
57
     */
58 3
    public function getSubscriptionId()
59
    {
60 3
        return $this->subscriptionId;
61
    }
62
63
    /**
64
     * Set the subscription ID.
65
     *
66
     * @param integer $subscriptionId The subscription ID.
67
     * @return RequestData
68
     */
69 3
    public function setSubscriptionId($subscriptionId)
70
    {
71 3
        $this->subscriptionId = $subscriptionId;
72
73 3
        return $this;
74
    }
75
76
    /**
77
     * Get the subscription start.
78
     *
79
     * @return \DateTime
80
     */
81 3
    public function getSubscriptionStart()
82
    {
83 3
        return $this->subscriptionStart;
84
    }
85
86
    /**
87
     * Set the subscription start.
88
     *
89
     * @param \DateTime $subscriptionStart The subscription start.
90
     * @return RequestData
91
     */
92 3
    public function setSubscriptionStart($subscriptionStart)
93
    {
94 3
        $this->subscriptionStart = $subscriptionStart;
95
96 3
        return $this;
97
    }
98
99
    /**
100
     * Get the subscription end.
101
     *
102
     * @return \DateTime
103
     */
104 3
    public function getSubscriptionEnd()
105
    {
106 3
        return $this->subscriptionEnd;
107
    }
108
109
    /**
110
     * Set the subscription end.
111
     *
112
     * @param \DateTime $subscriptionEnd The subscription end.
113
     * @return RequestData
114
     */
115 3
    public function setSubscriptionEnd($subscriptionEnd)
116
    {
117 3
        $this->subscriptionEnd = $subscriptionEnd;
118
119 3
        return $this;
120
    }
121
}
122