Skip to content

Commit 7efb118

Browse files
committed
Phpstan Catch-up
1 parent 019afe0 commit 7efb118

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

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

3030
### Fixed
3131

32-
- Nothing yet.
32+
- Micro-optimization in getSheetByName. [PR #4499](https://github.com/PHPOffice/PhpSpreadsheet/pull/4499)
33+
- Bug in resizeMatricesExtend. [Issue #4451](https://github.com/PHPOffice/PhpSpreadsheet/issues/4451) [PR #4474](https://github.com/PHPOffice/PhpSpreadsheet/pull/4474)
3334

3435
## 2025-06-22 - 4.4.0
3536

src/PhpSpreadsheet/Calculation/Calculation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ private static function resizeMatricesExtend(array &$matrix1, array &$matrix2, i
851851
if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
852852
if ($matrix2Columns < $matrix1Columns) {
853853
for ($i = 0; $i < $matrix2Rows; ++$i) {
854+
/** @var mixed[][] $matrix2 */
854855
$x = ($matrix2Columns === 1) ? $matrix2[$i][0] : null;
855856
for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
856857
$matrix2[$i][$j] = $x;
@@ -868,6 +869,7 @@ private static function resizeMatricesExtend(array &$matrix1, array &$matrix2, i
868869
if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
869870
if ($matrix1Columns < $matrix2Columns) {
870871
for ($i = 0; $i < $matrix1Rows; ++$i) {
872+
/** @var mixed[][] $matrix1 */
871873
$x = ($matrix1Columns === 1) ? $matrix1[$i][0] : null;
872874
for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
873875
$matrix1[$i][$j] = $x;
@@ -2372,13 +2374,15 @@ private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2,
23722374

23732375
for ($row = 0; $row < $rows; ++$row) {
23742376
for ($column = 0; $column < $columns; ++$column) {
2377+
/** @var mixed[][] $operand1 */
23752378
if (($operand1[$row][$column] ?? null) === null) {
23762379
$operand1[$row][$column] = 0;
23772380
} elseif (!self::isNumericOrBool($operand1[$row][$column])) {
23782381
$operand1[$row][$column] = self::makeError($operand1[$row][$column]);
23792382

23802383
continue;
23812384
}
2385+
/** @var mixed[][] $operand2 */
23822386
if (($operand2[$row][$column] ?? null) === null) {
23832387
$operand2[$row][$column] = 0;
23842388
} elseif (!self::isNumericOrBool($operand2[$row][$column])) {

0 commit comments

Comments
 (0)