@@ -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 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * @return the structures growth factor. |
|
| 40 | + * @return double structures growth factor. |
|
| 41 | 41 | */ |
| 42 | 42 | protected function getGrowthFactor(): float |
| 43 | 43 | { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | - * @return whether capacity should be increased. |
|
| 95 | + * @return boolean capacity should be increased. |
|
| 96 | 96 | */ |
| 97 | 97 | protected function shouldDecreaseCapacity(): bool |
| 98 | 98 | { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * @return whether capacity should be increased. |
|
| 103 | + * @return boolean capacity should be increased. |
|
| 104 | 104 | */ |
| 105 | 105 | protected function shouldIncreaseCapacity(): bool |
| 106 | 106 | { |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @return whether capacity should be increased. |
|
| 26 | + * @return boolean capacity should be increased. |
|
| 27 | 27 | */ |
| 28 | 28 | protected function shouldIncreaseCapacity(): bool |
| 29 | 29 | { |
@@ -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 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * Creates a new instance. |
| 29 | 29 | * |
| 30 | - * @param array|\Traversable|null $values |
|
| 30 | + * @param Map $values |
|
| 31 | 31 | */ |
| 32 | 32 | public function __construct($values = null) |
| 33 | 33 | { |
@@ -112,7 +112,7 @@ discard block |
||
| 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 | */ |