GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

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 66.67%

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A getSubscriptionId() 4 4 1
A setSubscriptionId() 6 6 1
A getCancellationDate() 4 4 1
A setCancellationDate() 6 6 1
A getCancellationNote() 4 4 1
A setCancellationNote() 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\Monsum\Api\Service\Subscription\Cancel;
4
5
use JMS\Serializer\Annotation as JMS;
6
use Speicher210\Monsum\Api\AbstractRequestData;
7
8
/**
9
 * The request data for cancellation of 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 cancellation date.
25
     *
26
     * @var \DateTime
27
     *
28
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
29
     * @JMS\SerializedName("cancellation_date")
30
     */
31
    protected $cancellationDate;
32
33
    /**
34
     * The reason for cancellation of a subscription.
35
     *
36
     * @var string
37
     *
38
     * @JMS\Type("string")
39
     * @JMS\SerializedName("CANCELLATION_NOTE")
40
     */
41
    protected $cancellationNote;
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
    public function getSubscriptionId()
59
    {
60
        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 cancellation date and time.
78
     *
79
     * @return \DateTime
80
     */
81
    public function getCancellationDate()
82
    {
83
        return $this->cancellationDate;
84
    }
85
86
    /**
87
     * Set the cancellation date and time.
88
     *
89
     * @param \DateTime $cancellationDate The cancellation date and time.
90
     * @return RequestData
91
     */
92 3
    public function setCancellationDate(\DateTime $cancellationDate = null)
93
    {
94 3
        $this->cancellationDate = $cancellationDate;
95
96 3
        return $this;
97
    }
98
99
    /**
100
     * Get the cancellation note.
101
     *
102
     * @return string
103
     */
104
    public function getCancellationNote()
105
    {
106
        return $this->cancellationNote;
107
    }
108
109
    /**
110
     * Set the cancellation note.
111
     *
112
     * @param string $cancellationNote The cancellation note.
113
     * @return RequestData
114
     */
115 3
    public function setCancellationNote($cancellationNote)
116
    {
117 3
        $this->cancellationNote = $cancellationNote;
118
119 3
        return $this;
120
    }
121
}
122