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.
The call to ConstSetLikeTrait::__construct() has too many arguments starting with $value.
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress.
In this case you can add the @ignorePhpDoc
annotation to the duplicate definition and it will be ignored.
Loading history...
25
}
26
$coll[] = $value;
27
}
28
$this->container = $coll;
29
} else {
30
$this->container = [];
31
}
32
}
33
34
/**
35
* {@inheritdoc}
36
*/
37
public function isEmpty()
38
{
39
return $this->count() === 0;
40
}
41
42
/**
43
* {@inheritdoc}
44
*/
45
public function count()
46
{
47
return count($this->container);
48
}
49
50
/**
51
* identical to at, implemented for ArrayAccess
52
*/
53
public function offsetGet($offset)
54
{
55
return $this->container[$offset];
56
}
57
58
/**
59
* {@inheritdoc}
60
*/
61
public function offsetExists($offset)
62
{
63
return $this->containsKey($offset);
64
}
65
66
/**
67
* {@inheritdoc}
68
*/
69
public function containsKey($key)
70
{
71
return array_key_exists($key, $this->container);
72
}
73
74
/**
75
* @inheritDoc
76
*/
77
public function contains($item)
78
{
79
return in_array($item, $this->container, true);
80
}
81
82
/**
83
* Returns an array containing the values from this VectorLike.
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.
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.