Skip to content

Commit 9d1ad14

Browse files
authored
Merge pull request #4349 from oleibman/updstan
Upgrade Phpstan
2 parents 2d4b9f3 + 4bbbbac commit 9d1ad14

File tree

4 files changed

+49
-52
lines changed

4 files changed

+49
-52
lines changed

composer.lock

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

infra/LocaleGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ protected function mapFunctionNameRows(): void
348348

349349
continue;
350350
}
351-
if ($cell->getValue() != '') {
351+
if ($cell->getValue() !== '') {
352352
if (is_bool($cell->getValue())) {
353353
$this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE'));
354354
$this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow();

src/PhpSpreadsheet/Worksheet/AutoFilter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ protected static function filterTestInSimpleDataSet(mixed $cellValue, array $dat
317317
{
318318
$dataSetValues = $dataSet['filterValues'];
319319
$blanks = $dataSet['blanks'];
320-
if (($cellValue == '') || ($cellValue === null)) {
320+
if (($cellValue === '') || ($cellValue === null)) {
321321
return $blanks;
322322
}
323323

@@ -333,7 +333,7 @@ protected static function filterTestInDateGroupSet(mixed $cellValue, array $data
333333
{
334334
$dateSet = $dataSet['filterValues'];
335335
$blanks = $dataSet['blanks'];
336-
if (($cellValue == '') || ($cellValue === null)) {
336+
if (($cellValue === '') || ($cellValue === null)) {
337337
return $blanks;
338338
}
339339
$timeZone = new DateTimeZone('UTC');
@@ -379,7 +379,7 @@ protected static function filterTestInCustomDataSet(mixed $cellValue, array $rul
379379

380380
if (!$customRuleForBlanks) {
381381
// Blank cells are always ignored, so return a FALSE
382-
if (($cellValue == '') || ($cellValue === null)) {
382+
if (($cellValue === '') || ($cellValue === null)) {
383383
return false;
384384
}
385385
}
@@ -424,7 +424,7 @@ protected static function filterTestInCustomDataSet(mixed $cellValue, array $rul
424424
}
425425
} elseif ($ruleValue == '') {
426426
$retVal = match ($ruleOperator) {
427-
Rule::AUTOFILTER_COLUMN_RULE_EQUAL => ($cellValue == '') || ($cellValue === null),
427+
Rule::AUTOFILTER_COLUMN_RULE_EQUAL => ($cellValue === '') || ($cellValue === null),
428428
Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL => ($cellValue != '') && ($cellValue !== null),
429429
default => true,
430430
};
@@ -486,7 +486,7 @@ protected static function filterTestInCustomDataSet(mixed $cellValue, array $rul
486486
protected static function filterTestInPeriodDateSet(mixed $cellValue, array $monthSet): bool
487487
{
488488
// Blank cells are always ignored, so return a FALSE
489-
if (($cellValue == '') || ($cellValue === null)) {
489+
if (($cellValue === '') || ($cellValue === null)) {
490490
return false;
491491
}
492492

src/PhpSpreadsheet/Writer/Xls/Worksheet.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,11 +2395,8 @@ public function processBitmapGd(GdImage $image): array
23952395
$data .= str_repeat("\x00", 4 - 3 * $width % 4);
23962396
}
23972397
}
2398-
// Phpstan says this always throws an exception before getting here.
2399-
// I don't see why, but I think this is code is never exercised
2400-
// in unit tests, so I can't say for sure it's wrong.
24012398

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

24052402
/**

0 commit comments

Comments
 (0)