Skip to content

Commit

Permalink
Merge pull request #4297 from oleibman/updatefixer
Browse files Browse the repository at this point in the history
Upgrade php-cs-fixer
  • Loading branch information
oleibman authored Jan 1, 2025
2 parents 2247863 + 14c6446 commit fb757cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ private function rows(array $arguments): array
private function columns(array $arguments): array
{
return array_map(
function (mixed $argument): int {
return is_array($argument) && is_array($argument[array_keys($argument)[0]])
fn (mixed $argument): int => is_array($argument) && is_array($argument[array_keys($argument)[0]])
? count($argument[array_keys($argument)[0]])
: 1;
},
: 1,
$arguments
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/PhpSpreadsheet/Calculation/MathTrig/Random.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min

return array_chunk(
array_map(
function () use ($min, $max, $wholeNumber): int|float {
return $wholeNumber
fn (): int|float => $wholeNumber
? mt_rand((int) $min, (int) $max)
: (mt_rand() / mt_getrandmax()) * ($max - $min) + $min;
},
: (mt_rand() / mt_getrandmax()) * ($max - $min) + $min,
array_fill(0, $rows * $columns, $min)
),
max($columns, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ public static function inverseRightTail(mixed $probability, mixed $degrees)
return ExcelError::NAN();
}

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

$newtonRaphson = new NewtonRaphson($callback);

Expand Down
6 changes: 2 additions & 4 deletions src/PhpSpreadsheet/Calculation/TextData/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,9 @@ private static function applyPadding(array $rows, mixed $padding): array
);

return array_map(
function (array $row) use ($columnCount, $padding): array {
return (count($row) < $columnCount)
fn (array $row): array => (count($row) < $columnCount)
? array_merge($row, array_fill(0, $columnCount - count($row), $padding))
: $row;
},
: $row,
$rows
);
}
Expand Down

0 comments on commit fb757cf

Please sign in to comment.