Skip to content

Commit

Permalink
Merge pull request #4359 from oleibman/stanbleed01
Browse files Browse the repository at this point in the history
Phpstan Bleeding Edge Part 1 of Many
  • Loading branch information
oleibman authored Feb 15, 2025
2 parents cf58236 + d9f4912 commit 9978d06
Show file tree
Hide file tree
Showing 12 changed files with 973 additions and 131 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).

### Changed

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

### Moved

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

### Fixed

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

## 2025-02-08 - 4.0.0

Expand Down
10 changes: 1 addition & 9 deletions infra/LocaleGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Column;
use PhpOffice\PhpSpreadsheet\Worksheet\Row;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

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

$languageNameMap = [];
foreach ($languagesList as $languageColumn) {
/** @var Column $languageColumn */
$cells = $languageColumn->getCellIterator(self::LOCALE_NAME_ROW, self::LOCALE_NAME_ROW);
$cells->setIterateOnlyExistingCells(true);
foreach ($cells as $cell) {
/** @var Cell $cell */
if ($this->localeCanBeSupported($translationWorksheet, $cell)) {
$languageNameMap[$cell->getColumn()] = $cell->getValue();
$this->log($cell->getColumn() . ' -> ' . $cell->getValue());
Expand Down Expand Up @@ -316,11 +312,9 @@ protected function mapErrorCodeRows(): void
$errorList = $this->localeTranslations->getRowIterator(self::ERROR_CODES_FIRST_ROW);

foreach ($errorList as $errorRow) {
/** @var Row $errorList */
$cells = $errorRow->getCellIterator(self::ENGLISH_REFERENCE_COLUMN, self::ENGLISH_REFERENCE_COLUMN);
$cells->setIterateOnlyExistingCells(true);
foreach ($cells as $cell) {
/** @var Cell $cell */
if ($cell->getValue() != '') {
$this->log($cell->getRow() . ' -> ' . $cell->getValue());
$this->errorCodeMap[$cell->getValue()] = $cell->getRow();
Expand All @@ -335,11 +329,9 @@ protected function mapFunctionNameRows(): void
$functionList = $this->functionNameTranslations->getRowIterator(self::FUNCTION_NAME_LIST_FIRST_ROW);

foreach ($functionList as $functionRow) {
/** @var Row $functionRow */
$cells = $functionRow->getCellIterator(self::ENGLISH_REFERENCE_COLUMN, self::ENGLISH_REFERENCE_COLUMN);
$cells->setIterateOnlyExistingCells(true);
foreach ($cells as $cell) {
/** @var Cell $cell */
if ($this->isFunctionCategoryEntry($cell)) {
if (!empty($cell->getValue())) {
$this->log('CATEGORY: ' . $cell->getValue());
Expand All @@ -348,7 +340,7 @@ protected function mapFunctionNameRows(): void

continue;
}
if ($cell->getValue() !== '') {
if ($cell->getValue() !== '' && $cell->getValue() !== null) {
if (is_bool($cell->getValue())) {
$this->log($cell->getRow() . ' -> ' . ($cell->getValue() ? 'TRUE' : 'FALSE'));
$this->functionNameMap[($cell->getValue() ? 'TRUE' : 'FALSE')] = $cell->getRow();
Expand Down
Loading

0 comments on commit 9978d06

Please sign in to comment.