Skip to content

Commit fb757cf

Browse files
authored
Merge pull request PHPOffice#4297 from oleibman/updatefixer
Upgrade php-cs-fixer
2 parents 2247863 + 14c6446 commit fb757cf

File tree

5 files changed

+14
-22
lines changed

5 files changed

+14
-22
lines changed

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,9 @@ private function rows(array $arguments): array
145145
private function columns(array $arguments): array
146146
{
147147
return array_map(
148-
function (mixed $argument): int {
149-
return is_array($argument) && is_array($argument[array_keys($argument)[0]])
148+
fn (mixed $argument): int => is_array($argument) && is_array($argument[array_keys($argument)[0]])
150149
? count($argument[array_keys($argument)[0]])
151-
: 1;
152-
},
150+
: 1,
153151
$arguments
154152
);
155153
}

src/PhpSpreadsheet/Calculation/MathTrig/Random.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min
8686

8787
return array_chunk(
8888
array_map(
89-
function () use ($min, $max, $wholeNumber): int|float {
90-
return $wholeNumber
89+
fn (): int|float => $wholeNumber
9190
? mt_rand((int) $min, (int) $max)
92-
: (mt_rand() / mt_getrandmax()) * ($max - $min) + $min;
93-
},
91+
: (mt_rand() / mt_getrandmax()) * ($max - $min) + $min,
9492
array_fill(0, $rows * $columns, $min)
9593
),
9694
max($columns, 1)

src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,8 @@ public static function inverseRightTail(mixed $probability, mixed $degrees)
133133
return ExcelError::NAN();
134134
}
135135

136-
$callback = function ($value) use ($degrees): float {
137-
return 1 - (Gamma::incompleteGamma($degrees / 2, $value / 2)
136+
$callback = fn ($value): float => 1 - (Gamma::incompleteGamma($degrees / 2, $value / 2)
138137
/ Gamma::gammaValue($degrees / 2));
139-
};
140138

141139
$newtonRaphson = new NewtonRaphson($callback);
142140

src/PhpSpreadsheet/Calculation/TextData/Text.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,9 @@ private static function applyPadding(array $rows, mixed $padding): array
171171
);
172172

173173
return array_map(
174-
function (array $row) use ($columnCount, $padding): array {
175-
return (count($row) < $columnCount)
174+
fn (array $row): array => (count($row) < $columnCount)
176175
? array_merge($row, array_fill(0, $columnCount - count($row), $padding))
177-
: $row;
178-
},
176+
: $row,
179177
$rows
180178
);
181179
}

0 commit comments

Comments
 (0)