Skip to content

Commit

Permalink
Merge pull request #4349 from oleibman/updstan
Browse files Browse the repository at this point in the history
Upgrade Phpstan
  • Loading branch information
oleibman authored Feb 8, 2025
2 parents 2d4b9f3 + 4bbbbac commit 9d1ad14
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 52 deletions.
84 changes: 42 additions & 42 deletions composer.lock

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

2 changes: 1 addition & 1 deletion infra/LocaleGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ protected function mapFunctionNameRows(): void

continue;
}
if ($cell->getValue() != '') {
if ($cell->getValue() !== '') {
if (is_bool($cell->getValue())) {
$this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE'));
$this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow();
Expand Down
10 changes: 5 additions & 5 deletions src/PhpSpreadsheet/Worksheet/AutoFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ protected static function filterTestInSimpleDataSet(mixed $cellValue, array $dat
{
$dataSetValues = $dataSet['filterValues'];
$blanks = $dataSet['blanks'];
if (($cellValue == '') || ($cellValue === null)) {
if (($cellValue === '') || ($cellValue === null)) {
return $blanks;
}

Expand All @@ -333,7 +333,7 @@ protected static function filterTestInDateGroupSet(mixed $cellValue, array $data
{
$dateSet = $dataSet['filterValues'];
$blanks = $dataSet['blanks'];
if (($cellValue == '') || ($cellValue === null)) {
if (($cellValue === '') || ($cellValue === null)) {
return $blanks;
}
$timeZone = new DateTimeZone('UTC');
Expand Down Expand Up @@ -379,7 +379,7 @@ protected static function filterTestInCustomDataSet(mixed $cellValue, array $rul

if (!$customRuleForBlanks) {
// Blank cells are always ignored, so return a FALSE
if (($cellValue == '') || ($cellValue === null)) {
if (($cellValue === '') || ($cellValue === null)) {
return false;
}
}
Expand Down Expand Up @@ -424,7 +424,7 @@ protected static function filterTestInCustomDataSet(mixed $cellValue, array $rul
}
} elseif ($ruleValue == '') {
$retVal = match ($ruleOperator) {
Rule::AUTOFILTER_COLUMN_RULE_EQUAL => ($cellValue == '') || ($cellValue === null),
Rule::AUTOFILTER_COLUMN_RULE_EQUAL => ($cellValue === '') || ($cellValue === null),
Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL => ($cellValue != '') && ($cellValue !== null),
default => true,
};
Expand Down Expand Up @@ -486,7 +486,7 @@ protected static function filterTestInCustomDataSet(mixed $cellValue, array $rul
protected static function filterTestInPeriodDateSet(mixed $cellValue, array $monthSet): bool
{
// Blank cells are always ignored, so return a FALSE
if (($cellValue == '') || ($cellValue === null)) {
if (($cellValue === '') || ($cellValue === null)) {
return false;
}

Expand Down
5 changes: 1 addition & 4 deletions src/PhpSpreadsheet/Writer/Xls/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -2395,11 +2395,8 @@ public function processBitmapGd(GdImage $image): array
$data .= str_repeat("\x00", 4 - 3 * $width % 4);
}
}
// Phpstan says this always throws an exception before getting here.
// I don't see why, but I think this is code is never exercised
// in unit tests, so I can't say for sure it's wrong.

return [$width, $height, strlen($data), $data]; //* @phpstan-ignore-line
return [$width, $height, strlen($data), $data];
}

/**
Expand Down

0 comments on commit 9d1ad14

Please sign in to comment.