Skip to content

Commit e1e5888

Browse files
author
MarkBaker
committed
PHP deprecation resolution
1 parent f5b4308 commit e1e5888

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

phpstan-baseline.neon

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ parameters:
155155
count: 1
156156
path: src/PhpSpreadsheet/Calculation/Calculation.php
157157

158+
-
159+
message: "#^Result of && is always false\\.$#"
160+
count: 1
161+
path: src/PhpSpreadsheet/Calculation/Calculation.php
162+
158163
-
159164
message: "#^Static property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:\\$instance \\(PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\) in isset\\(\\) is not nullable\\.$#"
160165
count: 1
@@ -1100,6 +1105,11 @@ parameters:
11001105
count: 1
11011106
path: src/PhpSpreadsheet/Cell/Coordinate.php
11021107

1108+
-
1109+
message: "#^Cannot use array destructuring on array\\<string\\>\\|string\\.$#"
1110+
count: 2
1111+
path: src/PhpSpreadsheet/Cell/Coordinate.php
1112+
11031113
-
11041114
message: "#^Parameter \\#4 \\$currentRow of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:validateRange\\(\\) expects int, string given\\.$#"
11051115
count: 1
@@ -2221,7 +2231,7 @@ parameters:
22212231
path: src/PhpSpreadsheet/Reader/Xls.php
22222232

22232233
-
2224-
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\<string\\>\\|string given\\.$#"
2234+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\<string\\>\\|string given\\.$#"
22252235
count: 1
22262236
path: src/PhpSpreadsheet/Reader/Xls.php
22272237

@@ -4052,7 +4062,7 @@ parameters:
40524062

40534063
-
40544064
message: "#^Cannot use array destructuring on array\\<string\\>\\|string\\.$#"
4055-
count: 1
4065+
count: 2
40564066
path: src/PhpSpreadsheet/Worksheet/AutoFilter.php
40574067

40584068
-
@@ -4110,6 +4120,16 @@ parameters:
41104120
count: 1
41114121
path: src/PhpSpreadsheet/Worksheet/SheetView.php
41124122

4123+
-
4124+
message: "#^Cannot use array destructuring on array\\<string\\>\\|string\\.$#"
4125+
count: 1
4126+
path: src/PhpSpreadsheet/Worksheet/Table.php
4127+
4128+
-
4129+
message: "#^Cannot use array destructuring on array\\<string\\>\\|string\\.$#"
4130+
count: 2
4131+
path: src/PhpSpreadsheet/Worksheet/Validations.php
4132+
41134133
-
41144134
message: "#^Cannot call method getCalculatedValue\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Cell\\|null\\.$#"
41154135
count: 1
@@ -4141,18 +4161,18 @@ parameters:
41414161
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
41424162

41434163
-
4144-
message: "#^Cannot use array destructuring on array\\<string\\>\\|string\\.$#"
4164+
message: "#^If condition is always true\\.$#"
41454165
count: 2
41464166
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
41474167

41484168
-
4149-
message: "#^If condition is always true\\.$#"
4169+
message: "#^Left side of && is always true\\.$#"
41504170
count: 2
41514171
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
41524172

41534173
-
4154-
message: "#^Left side of && is always true\\.$#"
4155-
count: 2
4174+
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:extractSheetTitle\\(\\) should return array\\<string\\>\\|string but returns array\\<int, null\\>\\|null\\.$#"
4175+
count: 1
41564176
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
41574177

41584178
-

src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ private function writeCellFormula(XMLWriter $objWriter, string $cellValue, Cell
13291329
$objWriter,
13301330
$this->getParentWriter()->getOffice2003Compatibility() === false,
13311331
'v',
1332-
($this->getParentWriter()->getPreCalculateFormulas() && !is_array($calculatedValue) && substr($calculatedValue, 0, 1) !== '#')
1332+
($this->getParentWriter()->getPreCalculateFormulas() && !is_array($calculatedValue) && substr($calculatedValue ?? '', 0, 1) !== '#')
13331333
? StringHelper::formatNumber($calculatedValue) : '0'
13341334
);
13351335
}

0 commit comments

Comments
 (0)