@@ -13,6 +13,7 @@ discard block |
||
| 13 | 13 | * object as initial values. |
| 14 | 14 | * |
| 15 | 15 | * @param array|\Traversable|null $values |
| 16 | + * @return void |
|
| 16 | 17 | */ |
| 17 | 18 | function __construct($values = null); |
| 18 | 19 | |
@@ -22,6 +23,7 @@ discard block |
||
| 22 | 23 | * @param int $capacity The number of values for which capacity should be |
| 23 | 24 | * allocated. Capacity will stay the same if this value |
| 24 | 25 | * is less than or equal to the current capacity. |
| 26 | + * @return void |
|
| 25 | 27 | */ |
| 26 | 28 | function allocate(int $capacity); |
| 27 | 29 | |
@@ -30,6 +32,7 @@ discard block |
||
| 30 | 32 | * return value as the new value. |
| 31 | 33 | * |
| 32 | 34 | * @param callable $callback Accepts the value, returns the new value. |
| 35 | + * @return void |
|
| 33 | 36 | */ |
| 34 | 37 | function apply(callable $callback); |
| 35 | 38 | |
@@ -101,6 +104,7 @@ discard block |
||
| 101 | 104 | * @param mixed ...$values |
| 102 | 105 | * |
| 103 | 106 | * @throws \OutOfRangeException if the index is not in the range [0, n] |
| 107 | + * @return void |
|
| 104 | 108 | */ |
| 105 | 109 | function insert(int $index, ...$values); |
| 106 | 110 | |
@@ -155,6 +159,7 @@ discard block |
||
| 155 | 159 | * Adds zero or more values to the end of the sequence. |
| 156 | 160 | * |
| 157 | 161 | * @param mixed ...$values |
| 162 | + * @return void |
|
| 158 | 163 | */ |
| 159 | 164 | function push(...$values); |
| 160 | 165 | |
@@ -184,6 +189,7 @@ discard block |
||
| 184 | 189 | |
| 185 | 190 | /** |
| 186 | 191 | * Reverses the sequence in-place. |
| 192 | + * @return void |
|
| 187 | 193 | */ |
| 188 | 194 | function reverse(); |
| 189 | 195 | |
@@ -200,6 +206,7 @@ discard block |
||
| 200 | 206 | * positive, or 'pop' and 'unshift' if negative. |
| 201 | 207 | * |
| 202 | 208 | * @param int $rotations The number of rotations (can be negative). |
| 209 | + * @return void |
|
| 203 | 210 | */ |
| 204 | 211 | function rotate(int $rotations); |
| 205 | 212 | |
@@ -210,6 +217,7 @@ discard block |
||
| 210 | 217 | * @param mixed $value |
| 211 | 218 | * |
| 212 | 219 | * @throws \OutOfRangeException if the index is not in the range [0, size-1] |
| 220 | + * @return void |
|
| 213 | 221 | */ |
| 214 | 222 | function set(int $index, $value); |
| 215 | 223 | |
@@ -251,6 +259,7 @@ discard block |
||
| 251 | 259 | * |
| 252 | 260 | * @param callable|null $comparator Accepts two values to be compared. |
| 253 | 261 | * Should return the result of a <=> b. |
| 262 | + * @return void |
|
| 254 | 263 | */ |
| 255 | 264 | function sort(callable $comparator = null); |
| 256 | 265 | |
@@ -276,6 +285,7 @@ discard block |
||
| 276 | 285 | * Adds zero or more values to the front of the sequence. |
| 277 | 286 | * |
| 278 | 287 | * @param mixed ...$values |
| 288 | + * @return void |
|
| 279 | 289 | */ |
| 280 | 290 | function unshift(...$values); |
| 281 | 291 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | /** |
| 122 | 122 | * Merge an array of values with the current Map |
| 123 | 123 | * |
| 124 | - * @param array|\Traversable $values |
|
| 124 | + * @param Map $values |
|
| 125 | 125 | * |
| 126 | 126 | * @return Map |
| 127 | 127 | */ |
@@ -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 | } |