Passed
Branch master (d0211e)
by Willy
02:44
created

AchievementValueObject   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 153
Duplicated Lines 13.73 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 10
lcom 0
cbo 0
dl 21
loc 153
ccs 0
cts 57
cp 0
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 21 21 1
A getId() 0 4 1
A getTitle() 0 4 1
A getPoints() 0 4 1
A getDescription() 0 4 1
A getRewardItems() 0 4 1
A getIcon() 0 4 1
A getCriteria() 0 4 1
A isAccountWide() 0 4 1
A getFactionId() 0 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
namespace Kubinashi\BattlenetApi\WorldOfWarcraft\CharacterProfileApi\Feed\Model;
4
5
use Kubinashi\BattlenetApi\WorldOfWarcraft\Shared\Criteria\Model\CriteriaValueObject;
6
7
/**
8
 * @author  Willy Reiche
9
 * @since   2017-08-22
10
 * @version 1.0
11
 */
12
class AchievementValueObject
13
{
14
    /**
15
     * @var int
16
     */
17
    private $id;
18
19
    /**
20
     * @var string
21
     */
22
    private $title;
23
24
    /**
25
     * @var int
26
     */
27
    private $points;
28
29
    /**
30
     * @var string
31
     */
32
    private $description;
33
34
    /**
35
     * @var string[]
36
     */
37
    private $rewardItems;
38
39
    /**
40
     * @var string
41
     */
42
    private $icon;
43
44
    /**
45
     * @var CriteriaValueObject[]
46
     */
47
    private $criteria;
48
49
    /**
50
     * @var bool
51
     */
52
    private $accountWide;
53
54
    /**
55
     * @var int
56
     */
57
    private $factionId;
58
59
    /**
60
     * AchievementValueObject constructor.
61
     * @param int                   $id
62
     * @param string                $title
63
     * @param int                   $points
64
     * @param string                $description
65
     * @param string[]              $rewardItems
66
     * @param string                $icon
67
     * @param CriteriaValueObject[] $criteria
68
     * @param bool                  $accountWide
69
     * @param int                   $factionId
70
     */
71 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method 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...
72
        $id,
73
        $title,
74
        $points,
75
        $description,
76
        $rewardItems,
77
        $icon,
78
        $criteria,
79
        $accountWide,
80
        $factionId
81
    ) {
82
        $this->id = $id;
83
        $this->title = $title;
84
        $this->points = $points;
85
        $this->description = $description;
86
        $this->rewardItems = $rewardItems;
87
        $this->icon = $icon;
88
        $this->criteria = $criteria;
89
        $this->accountWide = $accountWide;
90
        $this->factionId = $factionId;
91
    }
92
93
    /**
94
     * @return int
95
     */
96
    public function getId()
97
    {
98
        return $this->id;
99
    }
100
101
    /**
102
     * @return string
103
     */
104
    public function getTitle()
105
    {
106
        return $this->title;
107
    }
108
109
    /**
110
     * @return int
111
     */
112
    public function getPoints()
113
    {
114
        return $this->points;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function getDescription()
121
    {
122
        return $this->description;
123
    }
124
125
    /**
126
     * @return string[]
127
     */
128
    public function getRewardItems()
129
    {
130
        return $this->rewardItems;
131
    }
132
133
    /**
134
     * @return string
135
     */
136
    public function getIcon()
137
    {
138
        return $this->icon;
139
    }
140
141
    /**
142
     * @return CriteriaValueObject[]
143
     */
144
    public function getCriteria()
145
    {
146
        return $this->criteria;
147
    }
148
149
    /**
150
     * @return bool
151
     */
152
    public function isAccountWide()
153
    {
154
        return $this->accountWide;
155
    }
156
157
    /**
158
     * @return int
159
     */
160
    public function getFactionId()
161
    {
162
        return $this->factionId;
163
    }
164
}
165