Skip to content

Commit 9978d06

Browse files
authored
Merge pull request #4359 from oleibman/stanbleed01
Phpstan Bleeding Edge Part 1 of Many
2 parents cf58236 + d9f4912 commit 9978d06

File tree

12 files changed

+973
-131
lines changed

12 files changed

+973
-131
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1717

1818
### Changed
1919

20-
- Nothing yet.
20+
- Start migration to Phpstan 2. [PR #4359](https://github.com/PHPOffice/PhpSpreadsheet/pull/4359)
2121

2222
### Moved
2323

@@ -29,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
2929

3030
### Fixed
3131

32-
- Nothing yet.
32+
- Refactor Helper/Html. [PR #4359](https://github.com/PHPOffice/PhpSpreadsheet/pull/4359)
3333

3434
## 2025-02-08 - 4.0.0
3535

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)