@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function getEntries(): ListInterface |
| 40 | 40 | { |
| 41 | - return listOf(...array_map(function (string $key, $value) { |
|
| 41 | + return listOf(...array_map(function(string $key, $value) { |
|
| 42 | 42 | return pair($key, $value); |
| 43 | 43 | }, array_keys($this->array), $this->array)); |
| 44 | 44 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | { |
| 266 | 266 | $newInstance = emptyList(); |
| 267 | 267 | $newInstance->setArray(array_values( |
| 268 | - array_filter(array_map($transform, $this->array), function ($item) { |
|
| 268 | + array_filter(array_map($transform, $this->array), function($item) { |
|
| 269 | 269 | return $item !== null; |
| 270 | 270 | }) |
| 271 | 271 | )); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @param callable $action f(entry: Pair<scalar, mixed>) -> mixed|void |
| 319 | 319 | * @return void |
| 320 | 320 | */ |
| 321 | - public function forEach(callable $action): void |
|
| 321 | + public function forEach (callable $action): void |
|
| 322 | 322 | { |
| 323 | 323 | foreach ($this->array as $key => $value) { |
| 324 | 324 | $action(pair($key, $value)); |
@@ -202,7 +202,7 @@ |
||
| 202 | 202 | * @param callable $action f(entry: Pair) -> mixed|void |
| 203 | 203 | * @return void |
| 204 | 204 | */ |
| 205 | - public function forEach(callable $action): void; |
|
| 205 | + public function forEach (callable $action): void; |
|
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | 208 | * Returns a List containing all key-value pairs. |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | if (is_double($value)) { |
| 11 | 11 | $str = \strval($value); |
| 12 | 12 | if (strlen($str) == 1) { |
| 13 | - return sprintf("%1\$.1f",$value); |
|
| 13 | + return sprintf("%1\$.1f", $value); |
|
| 14 | 14 | } |
| 15 | 15 | return \strval($value); |
| 16 | 16 | } |
@@ -265,7 +265,7 @@ |
||
| 265 | 265 | * @param callable $action f(element: mixed) -> void|mixed |
| 266 | 266 | * @return void |
| 267 | 267 | */ |
| 268 | - public function forEach(callable $action): void; |
|
| 268 | + public function forEach (callable $action): void; |
|
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * Returns an element at the given index or the result of calling the defaultValue |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | public function flatten(): ListInterface |
| 204 | 204 | { |
| 205 | 205 | $flattenedArray = []; |
| 206 | - array_walk_recursive($this->array, function ($item) use (&$flattenedArray) { |
|
| 206 | + array_walk_recursive($this->array, function($item) use (&$flattenedArray) { |
|
| 207 | 207 | $flattenedArray[] = $item; |
| 208 | 208 | }); |
| 209 | 209 | return listOf(...$flattenedArray); |
@@ -228,15 +228,15 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function joinToString(string $delimiter, string $prefix = null, string $suffix = null): string |
| 230 | 230 | { |
| 231 | - $result = implode($delimiter, $this->map(function ($item) { |
|
| 231 | + $result = implode($delimiter, $this->map(function($item) { |
|
| 232 | 232 | assertStringable($item, "Elements in list must be convertible to string in order to use joinToString."); |
| 233 | 233 | return strval($item); |
| 234 | 234 | })->toArray()); |
| 235 | 235 | if ($prefix !== null) { |
| 236 | - $result = $prefix . $result; |
|
| 236 | + $result = $prefix.$result; |
|
| 237 | 237 | } |
| 238 | 238 | if ($suffix !== null) { |
| 239 | - $result = $result . $suffix; |
|
| 239 | + $result = $result.$suffix; |
|
| 240 | 240 | } |
| 241 | 241 | return $result; |
| 242 | 242 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | return listOf(...array_unique($this->array)); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | - public function forEach(callable $action): void |
|
| 378 | + public function forEach (callable $action): void |
|
| 379 | 379 | { |
| 380 | 380 | foreach ($this->array as $element) { |
| 381 | 381 | $action($element); |