@@ -239,8 +239,12 @@ |
||
239 | 239 | { |
240 | 240 | $n = count($this); |
241 | 241 | |
242 | - if ($n < 2) return 0; |
|
243 | - if ($r < 0) return $n - (abs($r) % $n); |
|
242 | + if ($n < 2) { |
|
243 | + return 0; |
|
244 | + } |
|
245 | + if ($r < 0) { |
|
246 | + return $n - (abs($r) % $n); |
|
247 | + } |
|
244 | 248 | |
245 | 249 | return $r % $n; |
246 | 250 | } |
@@ -88,7 +88,7 @@ |
||
88 | 88 | */ |
89 | 89 | protected function decreaseCapacity() |
90 | 90 | { |
91 | - $this->capacity = max(self::MIN_CAPACITY, $this->capacity * $this->getDecayFactor()); |
|
91 | + $this->capacity = max(self::MIN_CAPACITY, $this->capacity * $this->getDecayFactor()); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -19,6 +19,7 @@ discard block |
||
19 | 19 | * @param int $capacity The number of values for which capacity should be |
20 | 20 | * allocated. Capacity will stay the same if this value |
21 | 21 | * is less than or equal to the current capacity. |
22 | + * @return void |
|
22 | 23 | */ |
23 | 24 | function allocate(int $capacity); |
24 | 25 | |
@@ -27,6 +28,7 @@ discard block |
||
27 | 28 | * return value as the new value. |
28 | 29 | * |
29 | 30 | * @param callable $callback Accepts the value, returns the new value. |
31 | + * @return void |
|
30 | 32 | */ |
31 | 33 | function apply(callable $callback); |
32 | 34 | |
@@ -98,6 +100,7 @@ discard block |
||
98 | 100 | * @param mixed ...$values |
99 | 101 | * |
100 | 102 | * @throws \OutOfRangeException if the index is not in the range [0, n] |
103 | + * @return void |
|
101 | 104 | */ |
102 | 105 | function insert(int $index, ...$values); |
103 | 106 | |
@@ -152,6 +155,7 @@ discard block |
||
152 | 155 | * Adds zero or more values to the end of the sequence. |
153 | 156 | * |
154 | 157 | * @param mixed ...$values |
158 | + * @return void |
|
155 | 159 | */ |
156 | 160 | function push(...$values); |
157 | 161 | |
@@ -181,6 +185,7 @@ discard block |
||
181 | 185 | |
182 | 186 | /** |
183 | 187 | * Reverses the sequence in-place. |
188 | + * @return void |
|
184 | 189 | */ |
185 | 190 | function reverse(); |
186 | 191 | |
@@ -197,6 +202,7 @@ discard block |
||
197 | 202 | * positive, or 'pop' and 'unshift' if negative. |
198 | 203 | * |
199 | 204 | * @param int $rotations The number of rotations (can be negative). |
205 | + * @return void |
|
200 | 206 | */ |
201 | 207 | function rotate(int $rotations); |
202 | 208 | |
@@ -207,6 +213,7 @@ discard block |
||
207 | 213 | * @param mixed $value |
208 | 214 | * |
209 | 215 | * @throws \OutOfRangeException if the index is not in the range [0, size-1] |
216 | + * @return void |
|
210 | 217 | */ |
211 | 218 | function set(int $index, $value); |
212 | 219 | |
@@ -247,6 +254,7 @@ discard block |
||
247 | 254 | * |
248 | 255 | * @param callable|null $comparator Accepts two values to be compared. |
249 | 256 | * Should return the result of a <=> b. |
257 | + * @return void |
|
250 | 258 | */ |
251 | 259 | function sort(callable $comparator = null); |
252 | 260 | |
@@ -272,6 +280,7 @@ discard block |
||
272 | 280 | * Adds zero or more values to the front of the sequence. |
273 | 281 | * |
274 | 282 | * @param mixed ...$values |
283 | + * @return void |
|
275 | 284 | */ |
276 | 285 | function unshift(...$values); |
277 | 286 | } |