Skip to content

Commit 898fa0b

Browse files
committed
Phpstan Bleeding Edge Part 1 of Many
We currently use Phpstan Release 1. Release 2 has been available for some time, and we would like to stay current if possible. In order to get to Release 2, we first have to pass the "bleeding edge" tests for Release 1. I will do this by generating a new baseline using bleeding edge, then fix the baseline errors over several different PR's. This is the first of those.
1 parent cf58236 commit 898fa0b

File tree

11 files changed

+965
-127
lines changed

11 files changed

+965
-127
lines changed

infra/LocaleGenerator.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use PhpOffice\PhpSpreadsheet\Cell\Cell;
77
use PhpOffice\PhpSpreadsheet\IOFactory;
88
use PhpOffice\PhpSpreadsheet\Spreadsheet;
9-
use PhpOffice\PhpSpreadsheet\Worksheet\Column;
10-
use PhpOffice\PhpSpreadsheet\Worksheet\Row;
119
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
1210

1311
class LocaleGenerator
@@ -280,11 +278,9 @@ protected function mapLanguageColumns(Worksheet $translationWorksheet): array
280278

281279
$languageNameMap = [];
282280
foreach ($languagesList as $languageColumn) {
283-
/** @var Column $languageColumn */
284281
$cells = $languageColumn->getCellIterator(self::LOCALE_NAME_ROW, self::LOCALE_NAME_ROW);
285282
$cells->setIterateOnlyExistingCells(true);
286283
foreach ($cells as $cell) {
287-
/** @var Cell $cell */
288284
if ($this->localeCanBeSupported($translationWorksheet, $cell)) {
289285
$languageNameMap[$cell->getColumn()] = $cell->getValue();
290286
$this->log($cell->getColumn() . ' -> ' . $cell->getValue());
@@ -316,11 +312,9 @@ protected function mapErrorCodeRows(): void
316312
$errorList = $this->localeTranslations->getRowIterator(self::ERROR_CODES_FIRST_ROW);
317313

318314
foreach ($errorList as $errorRow) {
319-
/** @var Row $errorList */
320315
$cells = $errorRow->getCellIterator(self::ENGLISH_REFERENCE_COLUMN, self::ENGLISH_REFERENCE_COLUMN);
321316
$cells->setIterateOnlyExistingCells(true);
322317
foreach ($cells as $cell) {
323-
/** @var Cell $cell */
324318
if ($cell->getValue() != '') {
325319
$this->log($cell->getRow() . ' -> ' . $cell->getValue());
326320
$this->errorCodeMap[$cell->getValue()] = $cell->getRow();
@@ -335,11 +329,9 @@ protected function mapFunctionNameRows(): void
335329
$functionList = $this->functionNameTranslations->getRowIterator(self::FUNCTION_NAME_LIST_FIRST_ROW);
336330

337331
foreach ($functionList as $functionRow) {
338-
/** @var Row $functionRow */
339332
$cells = $functionRow->getCellIterator(self::ENGLISH_REFERENCE_COLUMN, self::ENGLISH_REFERENCE_COLUMN);
340333
$cells->setIterateOnlyExistingCells(true);
341334
foreach ($cells as $cell) {
342-
/** @var Cell $cell */
343335
if ($this->isFunctionCategoryEntry($cell)) {
344336
if (!empty($cell->getValue())) {
345337
$this->log('CATEGORY: ' . $cell->getValue());
@@ -348,7 +340,7 @@ protected function mapFunctionNameRows(): void
348340

349341
continue;
350342
}
351-
if ($cell->getValue() !== '') {
343+
if ($cell->getValue() !== '' && $cell->getValue() !== null) {
352344
if (is_bool($cell->getValue())) {
353345
$this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE'));
354346
$this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow();

0 commit comments

Comments
 (0)