The call to StaticCollection::__construct() has too many arguments starting with $sliced.
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...
39
103
}
40
41
103
/**
42
103
* @return int
43
*/
44
public function count()
45
{
46
return count($this->set);
47
3
}
48
49
3
/**
50
* @return mixed
51
*/
52
public function bottom()
53
{
54
return $this->offsetGet(count($this) - 1);
55
39
}
56
57
39
/**
58
* @return bool
59
*/
60
public function isNull()
61
{
62
return count($this->set) === 0;
63
102
}
64
65
102
/**
66
102
* @return void
67
*/
68
public function rewind()
69
{
70
$this->position = 0;
71
103
}
72
73
103
/**
74
* @return mixed
75
*/
76
public function current()
77
{
78
return $this->set[$this->position];
79
}
80
30
81
/**
82
30
* @return int
83
*/
84
public function key()
85
{
86
return $this->position;
87
}
88
3
89
/**
90
3
* @return void
91
*/
92
public function next()
93
{
94
++$this->position;
95
}
96
97
12
/**
98
* @return bool
99
12
*/
100
6
public function valid()
101
{
102
6
return isset($this->set[$this->position]);
103
}
104
105
/**
106
* @param int $offset
107
* @return bool
108
*/
109
6
public function offsetExists($offset)
110
{
111
6
return array_key_exists($offset, $this->set);
112
}
113
114
/**
115
* @param int $offset
116
*/
117
public function offsetUnset($offset)
118
{
119
throw new \RuntimeException('Cannot unset from a Static Collection');
120
}
121
122
/**
123
* @param int $offset
124
* @return mixed
125
*/
126
public function offsetGet($offset)
127
{
128
if (!array_key_exists($offset, $this->set)) {
129
throw new \OutOfRangeException('Nothing found at this offset');
130
}
131
132
return $this->set[$offset];
133
}
134
135
/**
136
* @param int $offset
137
* @param mixed $value
138
*/
139
public function offsetSet($offset, $value)
140
{
141
throw new \RuntimeException('Cannot add to a Static Collection');
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.