Passed
Push — master ( 86b291...5e082c )
by Willy
02:08
created

RelicValueObject   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 15.71 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 0
dl 11
loc 70
ccs 0
cts 27
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 1
A getSocket() 0 4 1
A getItemId() 0 4 1
A getContext() 0 4 1
A getBonusLists() 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\Model\Item;
4
5
/**
6
 * @author  Willy Reiche
7
 * @since   2017-08-23
8
 * @version 1.0
9
 */
10
class RelicValueObject
11
{
12
    /**
13
     * @var int
14
     */
15
    private $socket;
16
    /**
17
     * @var int
18
     */
19
    private $itemId;
20
    /**
21
     * @var int
22
     */
23
    private $context;
24
    /**
25
     * @var int[]
26
     */
27
    private $bonusLists;
28
29
    /**
30
     * RelicValueObject constructor.
31
     * @param int   $socket
32
     * @param int   $itemId
33
     * @param int   $context
34
     * @param int[] $bonusLists
35
     */
36 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...
37
        $socket,
38
        $itemId,
39
        $context,
40
        $bonusLists
41
    ) {
42
        $this->socket = $socket;
43
        $this->itemId = $itemId;
44
        $this->context = $context;
45
        $this->bonusLists = $bonusLists;
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getSocket()
52
    {
53
        return $this->socket;
54
    }
55
56
    /**
57
     * @return int
58
     */
59
    public function getItemId()
60
    {
61
        return $this->itemId;
62
    }
63
64
    /**
65
     * @return int
66
     */
67
    public function getContext()
68
    {
69
        return $this->context;
70
    }
71
72
    /**
73
     * @return int[]
74
     */
75
    public function getBonusLists()
76
    {
77
        return $this->bonusLists;
78
    }
79
}
80