Skip to content

Commit d1d12ed

Browse files
committed
Phpstan Level 9 - Part 1 of Many
Dealing mostly with mixed variable type. In a great many cases, problems can be resolved replacing `getValue` with `getValueString` or `getCalculatedValue` with `getCalculatedValueString`.
1 parent 875dc35 commit d1d12ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2208
-199
lines changed

infra/DocumentGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ private static function tableRow(array $lengths, ?array $values = null): string
5252
return rtrim($result, ' ');
5353
}
5454

55+
/** @param array<int,string>|scalar $functionCall */
5556
private static function getPhpSpreadsheetFunctionText(mixed $functionCall): string
5657
{
5758
if (is_string($functionCall)) {

infra/LocaleGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ protected function mapLanguageColumns(Worksheet $translationWorksheet): array
283283
foreach ($cells as $cell) {
284284
if ($this->localeCanBeSupported($translationWorksheet, $cell)) {
285285
$languageNameMap[$cell->getColumn()] = $cell->getValue();
286-
$this->log($cell->getColumn() . ' -> ' . $cell->getValue());
286+
$this->log($cell->getColumn() . ' -> ' . $cell->getValueString());
287287
}
288288
}
289289
}
@@ -316,7 +316,7 @@ protected function mapErrorCodeRows(): void
316316
$cells->setIterateOnlyExistingCells(true);
317317
foreach ($cells as $cell) {
318318
if ($cell->getValue() != '') {
319-
$this->log($cell->getRow() . ' -> ' . $cell->getValue());
319+
$this->log($cell->getRow() . ' -> ' . $cell->getValueString());
320320
$this->errorCodeMap[$cell->getValue()] = $cell->getRow();
321321
}
322322
}
@@ -334,7 +334,7 @@ protected function mapFunctionNameRows(): void
334334
foreach ($cells as $cell) {
335335
if ($this->isFunctionCategoryEntry($cell)) {
336336
if (!empty($cell->getValue())) {
337-
$this->log('CATEGORY: ' . $cell->getValue());
337+
$this->log('CATEGORY: ' . $cell->getValueString());
338338
$this->functionNameMap[$cell->getValue()] = $cell->getRow();
339339
}
340340

@@ -345,7 +345,7 @@ protected function mapFunctionNameRows(): void
345345
$this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE'));
346346
$this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow();
347347
} else {
348-
$this->log($cell->getRow() . ' -> ' . $cell->getValue());
348+
$this->log($cell->getRow() . ' -> ' . $cell->getValueString());
349349
$this->functionNameMap[$cell->getValue()] = $cell->getRow();
350350
}
351351
}

0 commit comments

Comments
 (0)