@@ -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 | } |
@@ -112,7 +112,7 @@ |
||
112 | 112 | * Returns the result of associating all keys of a given traversable object |
113 | 113 | * or array with their corresponding values, as well as those of this map. |
114 | 114 | * |
115 | - * @param array|\Traversable $values |
|
115 | + * @param Map $values |
|
116 | 116 | * |
117 | 117 | * @return Map |
118 | 118 | */ |
@@ -18,6 +18,7 @@ discard block |
||
18 | 18 | * object as initial values. |
19 | 19 | * |
20 | 20 | * @param array|\Traversable|null $values |
21 | + * @return void |
|
21 | 22 | */ |
22 | 23 | public function __construct($values = null); |
23 | 24 | |
@@ -27,6 +28,7 @@ discard block |
||
27 | 28 | * @param int $capacity The number of values for which capacity should be |
28 | 29 | * allocated. Capacity will stay the same if this value |
29 | 30 | * is less than or equal to the current capacity. |
31 | + * @return void |
|
30 | 32 | */ |
31 | 33 | public function allocate(int $capacity); |
32 | 34 | |
@@ -35,6 +37,7 @@ discard block |
||
35 | 37 | * return value as the new value. |
36 | 38 | * |
37 | 39 | * @param callable $callback Accepts the value, returns the new value. |
40 | + * @return void |
|
38 | 41 | */ |
39 | 42 | public function apply(callable $callback); |
40 | 43 | |
@@ -106,6 +109,7 @@ discard block |
||
106 | 109 | * @param mixed ...$values |
107 | 110 | * |
108 | 111 | * @throws \OutOfRangeException if the index is not in the range [0, n] |
112 | + * @return void |
|
109 | 113 | */ |
110 | 114 | public function insert(int $index, ...$values); |
111 | 115 | |
@@ -160,6 +164,7 @@ discard block |
||
160 | 164 | * Adds zero or more values to the end of the sequence. |
161 | 165 | * |
162 | 166 | * @param mixed ...$values |
167 | + * @return void |
|
163 | 168 | */ |
164 | 169 | public function push(...$values); |
165 | 170 | |
@@ -189,6 +194,7 @@ discard block |
||
189 | 194 | |
190 | 195 | /** |
191 | 196 | * Reverses the sequence in-place. |
197 | + * @return void |
|
192 | 198 | */ |
193 | 199 | public function reverse(); |
194 | 200 | |
@@ -205,6 +211,7 @@ discard block |
||
205 | 211 | * positive, or 'pop' and 'unshift' if negative. |
206 | 212 | * |
207 | 213 | * @param int $rotations The number of rotations (can be negative). |
214 | + * @return void |
|
208 | 215 | */ |
209 | 216 | public function rotate(int $rotations); |
210 | 217 | |
@@ -215,6 +222,7 @@ discard block |
||
215 | 222 | * @param mixed $value |
216 | 223 | * |
217 | 224 | * @throws \OutOfRangeException if the index is not in the range [0, size-1] |
225 | + * @return void |
|
218 | 226 | */ |
219 | 227 | public function set(int $index, $value); |
220 | 228 | |
@@ -255,6 +263,7 @@ discard block |
||
255 | 263 | * |
256 | 264 | * @param callable|null $comparator Accepts two values to be compared. |
257 | 265 | * Should return the result of a <=> b. |
266 | + * @return void |
|
258 | 267 | */ |
259 | 268 | public function sort(callable $comparator = null); |
260 | 269 | |
@@ -280,6 +289,7 @@ discard block |
||
280 | 289 | * Adds zero or more values to the front of the sequence. |
281 | 290 | * |
282 | 291 | * @param mixed ...$values |
292 | + * @return void |
|
283 | 293 | */ |
284 | 294 | public function unshift(...$values); |
285 | 295 | } |