Passed
Push — master ( 64ab61...b96172 )
by Gabor
09:36
created

ApplicationEntity   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 167
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 15
lcom 0
cbo 0
dl 167
loc 167
ccs 37
cts 37
cp 1
rs 10
c 0
b 0
f 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getKeyData() 4 4 1
A setApplicationId() 6 6 1
A getApplicationId() 4 4 1
A setName() 6 6 1
A getName() 4 4 1
A setTitle() 6 6 1
A getTitle() 4 4 1
A setDescription() 6 6 1
A getDescription() 4 4 1
A setReadOnly() 6 6 1
A getReadOnly() 4 4 1
A setDateCreated() 6 6 1
A getDateCreated() 4 4 1
A setDateModified() 6 6 1
A getDateModified() 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
 * WebHemi.
4
 *
5
 * PHP version 5.6
6
 *
7
 * @copyright 2012 - 2016 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
namespace WebHemi\Data\Entity;
13
14
use DateTime;
15
16
/**
17
 * Class ApplicationEntity.
18
 */
19 View Code Duplication
class ApplicationEntity implements DataEntityInterface
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...
20
{
21
    /** @var int */
22
    private $applicationId;
23
    /** @var string */
24
    private $name;
25
    /** @var string */
26
    private $title;
27
    /** @var string */
28
    private $description;
29
    /** @var bool */
30
    private $isReadOnly;
31
    /** @var DateTime */
32
    private $dateCreated;
33
    /** @var DateTime */
34
    private $dateModified;
35
36
    /**
37
     * Gets the value of the entity identifier.
38
     *
39
     * @return int
40
     */
41 1
    public function getKeyData()
42
    {
43 1
        return $this->applicationId;
44
    }
45
46
    /**
47
     * @param int $applicationId
48
     *
49
     * @return ApplicationEntity
50
     */
51 5
    public function setApplicationId($applicationId)
52
    {
53 5
        $this->applicationId = $applicationId;
54
55 5
        return $this;
56
    }
57
58
    /**
59
     * @return int
60
     */
61 3
    public function getApplicationId()
62
    {
63 3
        return $this->applicationId;
64
    }
65
66
    /**
67
     * @param string $name
68
     *
69
     * @return ApplicationEntity
70
     */
71 2
    public function setName($name)
72
    {
73 2
        $this->name = $name;
74
75 2
        return $this;
76
    }
77
78
    /**
79
     * @return string
80
     */
81 1
    public function getName()
82
    {
83 1
        return $this->name;
84
    }
85
86
    /**
87
     * @param string $title
88
     *
89
     * @return ApplicationEntity
90
     */
91 2
    public function setTitle($title)
92
    {
93 2
        $this->title = $title;
94
95 2
        return $this;
96
    }
97
98
    /**
99
     * @return string
100
     */
101 1
    public function getTitle()
102
    {
103 1
        return $this->title;
104
    }
105
106
    /**
107
     * @param string $description
108
     *
109
     * @return ApplicationEntity
110
     */
111 2
    public function setDescription($description)
112
    {
113 2
        $this->description = $description;
114
115 2
        return $this;
116
    }
117
118
    /**
119
     * @return string
120
     */
121 1
    public function getDescription()
122
    {
123 1
        return $this->description;
124
    }
125
126
    /**
127
     * @param bool $state
128
     *
129
     * @return ApplicationEntity
130
     */
131 2
    public function setReadOnly($state)
132
    {
133 2
        $this->isReadOnly = (bool) $state;
134
135 2
        return $this;
136
    }
137
138
    /**
139
     * @return bool
140
     */
141 1
    public function getReadOnly()
142
    {
143 1
        return $this->isReadOnly;
144
    }
145
146
    /**
147
     * @param DateTime $dateCreated
148
     *
149
     * @return ApplicationEntity
150
     */
151 2
    public function setDateCreated(DateTime $dateCreated)
152
    {
153 2
        $this->dateCreated = $dateCreated;
154
155 2
        return $this;
156
    }
157
158
    /**
159
     * @return DateTime
160
     */
161 1
    public function getDateCreated()
162
    {
163 1
        return $this->dateCreated;
164
    }
165
166
    /**
167
     * @param DateTime $dateModified
168
     *
169
     * @return ApplicationEntity
170
     */
171 2
    public function setDateModified(DateTime $dateModified)
172
    {
173 2
        $this->dateModified = $dateModified;
174
175 2
        return $this;
176
    }
177
178
    /**
179
     * @return DateTime
180
     */
181 1
    public function getDateModified()
182
    {
183 1
        return $this->dateModified;
184
    }
185
}
186