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
/**
22
* Sets the optional contained edges.
23
*
24
* @param EdgeInterface[] $edges
25
*/
26
public function __construct(EdgeInterface ...$edges)
27
{
28
$this->data = $edges;
29
}
30
31
/**
32
* Sets the contained edges.
33
*
34
* @param EdgeInterface[] $edges
35
*/
36
public function set(EdgeInterface ...$edges)
37
{
38
$this->data = $edges;
39
}
40
41
/**
42
* Adds some edges.
43
*
44
* @param EdgeInterface[] $edges
45
*/
46
public function add(EdgeInterface ...$edges)
47
{
48
$this->data = array_merge($this->data, $edges);
49
}
50
51
/**
52
* Checks if all the edges are contained.
53
*
54
* @param EdgeInterface[] $edges
55
*
56
* @return bool
57
*/
58
public function has(EdgeInterface ...$edges): bool
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.