Skip to content

Commit e243476

Browse files
author
MarkBaker
committed
Initial work on refactoring branch pruning logic
1 parent a7a48bf commit e243476

File tree

4 files changed

+379
-275
lines changed

4 files changed

+379
-275
lines changed

phpstan-baseline.neon

+52-82
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ parameters:
9595
count: 1
9696
path: src/PhpSpreadsheet/Calculation/Calculation.php
9797

98-
-
99-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:getUnusedBranchStoreKey\\(\\) has no return type specified\\.$#"
100-
count: 1
101-
path: src/PhpSpreadsheet/Calculation/Calculation.php
102-
10398
-
10499
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:localeFunc\\(\\) has no return type specified\\.$#"
105100
count: 1
@@ -125,6 +120,16 @@ parameters:
125120
count: 1
126121
path: src/PhpSpreadsheet/Calculation/Calculation.php
127122

123+
-
124+
message: "#^Offset 'type' does not exist on array\\|null\\.$#"
125+
count: 3
126+
path: src/PhpSpreadsheet/Calculation/Calculation.php
127+
128+
-
129+
message: "#^Offset 'value' does not exist on array\\|null\\.$#"
130+
count: 3
131+
path: src/PhpSpreadsheet/Calculation/Calculation.php
132+
128133
-
129134
message: "#^Parameter \\#1 \\$haystack of function stripos expects string, float\\|int\\|string given\\.$#"
130135
count: 1
@@ -146,12 +151,12 @@ parameters:
146151
path: src/PhpSpreadsheet/Calculation/Calculation.php
147152

148153
-
149-
message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, int\\|string given\\.$#"
154+
message: "#^Parameter \\#1 \\$str of function trim expects string, int\\|string given\\.$#"
150155
count: 1
151156
path: src/PhpSpreadsheet/Calculation/Calculation.php
152157

153158
-
154-
message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, null given\\.$#"
159+
message: "#^Parameter \\#1 \\$str of function trim expects string, null given\\.$#"
155160
count: 2
156161
path: src/PhpSpreadsheet/Calculation/Calculation.php
157162

@@ -165,11 +170,6 @@ parameters:
165170
count: 1
166171
path: src/PhpSpreadsheet/Calculation/Calculation.php
167172

168-
-
169-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:\\$branchPruningEnabled has no type specified\\.$#"
170-
count: 1
171-
path: src/PhpSpreadsheet/Calculation/Calculation.php
172-
173173
-
174174
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:\\$cellStack has no type specified\\.$#"
175175
count: 1
@@ -246,7 +246,12 @@ parameters:
246246
path: src/PhpSpreadsheet/Calculation/Calculation.php
247247

248248
-
249-
message: "#^Strict comparison using \\=\\=\\= between mixed and null will always evaluate to false\\.$#"
249+
message: "#^Strict comparison using \\=\\=\\= between array and '\\(' will always evaluate to false\\.$#"
250+
count: 1
251+
path: src/PhpSpreadsheet/Calculation/Calculation.php
252+
253+
-
254+
message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-array and null will always evaluate to false\\.$#"
250255
count: 2
251256
path: src/PhpSpreadsheet/Calculation/Calculation.php
252257

@@ -361,12 +366,12 @@ parameters:
361366
path: src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
362367

363368
-
364-
message: "#^Parameter \\#1 \\$num(ber)? of function floor expects float(.int)?, float\\|int\\<0, 281474976710655\\>\\|string given\\.$#"
369+
message: "#^Parameter \\#1 \\$number of function floor expects float, float\\|int\\<0, 281474976710655\\>\\|string given\\.$#"
365370
count: 1
366371
path: src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
367372

368373
-
369-
message: "#^Parameter \\#1 \\$num(ber)? of function floor expects float(.int)?, float\\|int\\|string given\\.$#"
374+
message: "#^Parameter \\#1 \\$number of function floor expects float, float\\|int\\|string given\\.$#"
370375
count: 1
371376
path: src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
372377

@@ -821,12 +826,12 @@ parameters:
821826
path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
822827

823828
-
824-
message: "#^Parameter \\#1 \\$(low|start) of function range expects float\\|int\\|string, string\\|null given\\.$#"
829+
message: "#^Parameter \\#1 \\$low of function range expects float\\|int\\|string, string\\|null given\\.$#"
825830
count: 1
826831
path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
827832

828833
-
829-
message: "#^Parameter \\#2 \\$(high|end) of function range expects float\\|int\\|string, string\\|null given\\.$#"
834+
message: "#^Parameter \\#2 \\$high of function range expects float\\|int\\|string, string\\|null given\\.$#"
830835
count: 1
831836
path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
832837

@@ -1180,41 +1185,6 @@ parameters:
11801185
count: 1
11811186
path: src/PhpSpreadsheet/Calculation/TextData/Text.php
11821187

1183-
-
1184-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has no return type specified\\.$#"
1185-
count: 1
1186-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1187-
1188-
-
1189-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has parameter \\$onlyIf with no type specified\\.$#"
1190-
count: 1
1191-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1192-
1193-
-
1194-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has parameter \\$onlyIfNot with no type specified\\.$#"
1195-
count: 1
1196-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1197-
1198-
-
1199-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has parameter \\$reference with no type specified\\.$#"
1200-
count: 1
1201-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1202-
1203-
-
1204-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has parameter \\$storeKey with no type specified\\.$#"
1205-
count: 1
1206-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1207-
1208-
-
1209-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has parameter \\$type with no type specified\\.$#"
1210-
count: 1
1211-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1212-
1213-
-
1214-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has parameter \\$value with no type specified\\.$#"
1215-
count: 1
1216-
path: src/PhpSpreadsheet/Calculation/Token/Stack.php
1217-
12181188
-
12191189
message: "#^Elseif branch is unreachable because previous condition is always true\\.$#"
12201190
count: 1
@@ -1256,12 +1226,12 @@ parameters:
12561226
path: src/PhpSpreadsheet/Cell/Coordinate.php
12571227

12581228
-
1259-
message: "#^Parameter \\#1 \\$(input|array) of function array_chunk expects array, array\\<int, string\\>\\|false given\\.$#"
1229+
message: "#^Parameter \\#1 \\$input of function array_chunk expects array, array\\<int, string\\>\\|false given\\.$#"
12601230
count: 1
12611231
path: src/PhpSpreadsheet/Cell/Coordinate.php
12621232

12631233
-
1264-
message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, array\\<int, string\\>\\|string given\\.$#"
1234+
message: "#^Parameter \\#2 \\$str of function explode expects string, array\\<int, string\\>\\|string given\\.$#"
12651235
count: 1
12661236
path: src/PhpSpreadsheet/Cell/Coordinate.php
12671237

@@ -1946,7 +1916,7 @@ parameters:
19461916
path: src/PhpSpreadsheet/Helper/Html.php
19471917

19481918
-
1949-
message: "#^Parameter \\#1 \\$(function|callback) of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\), mixed\\} given\\.$#"
1919+
message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\), mixed\\} given\\.$#"
19501920
count: 1
19511921
path: src/PhpSpreadsheet/Helper/Html.php
19521922

@@ -2521,7 +2491,7 @@ parameters:
25212491
path: src/PhpSpreadsheet/Reader/Xls/MD5.php
25222492

25232493
-
2524-
message: "#^Parameter \\#1 \\$(input|array) of function array_values expects array, array\\|false given\\.$#"
2494+
message: "#^Parameter \\#1 \\$input of function array_values expects array, array\\|false given\\.$#"
25252495
count: 1
25262496
path: src/PhpSpreadsheet/Reader/Xls/MD5.php
25272497

@@ -3336,37 +3306,37 @@ parameters:
33363306
path: src/PhpSpreadsheet/Shared/Drawing.php
33373307

33383308
-
3339-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Drawing\\:\\:imagecreatefrombmp\\(\\) should return GdImage\\|resource but returns (GdImage|resource)\\|false\\.$#"
3309+
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Drawing\\:\\:imagecreatefrombmp\\(\\) should return GdImage\\|resource but returns resource\\|false\\.$#"
33403310
count: 1
33413311
path: src/PhpSpreadsheet/Shared/Drawing.php
33423312

33433313
-
3344-
message: "#^Parameter \\#1 \\$(fp|stream) of function feof expects resource, resource\\|false given\\.$#"
3314+
message: "#^Parameter \\#1 \\$fp of function feof expects resource, resource\\|false given\\.$#"
33453315
count: 1
33463316
path: src/PhpSpreadsheet/Shared/Drawing.php
33473317

33483318
-
3349-
message: "#^Parameter \\#1 \\$(fp|stream) of function fread expects resource, resource\\|false given\\.$#"
3319+
message: "#^Parameter \\#1 \\$fp of function fread expects resource, resource\\|false given\\.$#"
33503320
count: 2
33513321
path: src/PhpSpreadsheet/Shared/Drawing.php
33523322

33533323
-
3354-
message: "#^Parameter \\#1 \\$im(age)? of function imagecolorallocate expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#"
3324+
message: "#^Parameter \\#1 \\$im of function imagecolorallocate expects resource, resource\\|false given\\.$#"
33553325
count: 1
33563326
path: src/PhpSpreadsheet/Shared/Drawing.php
33573327

33583328
-
3359-
message: "#^Parameter \\#1 \\$im(age)? of function imagesetpixel expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#"
3329+
message: "#^Parameter \\#1 \\$im of function imagesetpixel expects resource, resource\\|false given\\.$#"
33603330
count: 1
33613331
path: src/PhpSpreadsheet/Shared/Drawing.php
33623332

33633333
-
3364-
message: "#^Parameter \\#1 \\$(x_size|width) of function imagecreatetruecolor expects int, float\\|int given\\.$#"
3334+
message: "#^Parameter \\#1 \\$x_size of function imagecreatetruecolor expects int, float\\|int given\\.$#"
33653335
count: 1
33663336
path: src/PhpSpreadsheet/Shared/Drawing.php
33673337

33683338
-
3369-
message: "#^Parameter \\#2 \\$(data|string) of function unpack expects string, string\\|false given\\.$#"
3339+
message: "#^Parameter \\#2 \\$data of function unpack expects string, string\\|false given\\.$#"
33703340
count: 1
33713341
path: src/PhpSpreadsheet/Shared/Drawing.php
33723342

@@ -3376,7 +3346,7 @@ parameters:
33763346
path: src/PhpSpreadsheet/Shared/Drawing.php
33773347

33783348
-
3379-
message: "#^Parameter \\#2 \\$(y_size|height) of function imagecreatetruecolor expects int, float\\|int given\\.$#"
3349+
message: "#^Parameter \\#2 \\$y_size of function imagecreatetruecolor expects int, float\\|int given\\.$#"
33803350
count: 1
33813351
path: src/PhpSpreadsheet/Shared/Drawing.php
33823352

@@ -3396,7 +3366,7 @@ parameters:
33963366
path: src/PhpSpreadsheet/Shared/Drawing.php
33973367

33983368
-
3399-
message: "#^Parameter \\#4 \\$col(or)? of function imagesetpixel expects int, int\\|false given\\.$#"
3369+
message: "#^Parameter \\#4 \\$col of function imagesetpixel expects int, int\\|false given\\.$#"
34003370
count: 1
34013371
path: src/PhpSpreadsheet/Shared/Drawing.php
34023372

@@ -3596,7 +3566,7 @@ parameters:
35963566
path: src/PhpSpreadsheet/Shared/JAMA/Matrix.php
35973567

35983568
-
3599-
message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, float\\|int given\\.$#"
3569+
message: "#^Parameter \\#1 \\$str of function trim expects string, float\\|int given\\.$#"
36003570
count: 1
36013571
path: src/PhpSpreadsheet/Shared/JAMA/Matrix.php
36023572

@@ -3676,7 +3646,7 @@ parameters:
36763646
path: src/PhpSpreadsheet/Shared/OLE.php
36773647

36783648
-
3679-
message: "#^Parameter \\#2 \\$(data|string) of function unpack expects string, string\\|false given\\.$#"
3649+
message: "#^Parameter \\#2 \\$data of function unpack expects string, string\\|false given\\.$#"
36803650
count: 3
36813651
path: src/PhpSpreadsheet/Shared/OLE.php
36823652

@@ -3716,7 +3686,7 @@ parameters:
37163686
path: src/PhpSpreadsheet/Shared/OLE.php
37173687

37183688
-
3719-
message: "#^Parameter \\#1 \\$(var|value) of function count expects array\\|Countable, string given\\.$#"
3689+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, string given\\.$#"
37203690
count: 1
37213691
path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php
37223692

@@ -4061,7 +4031,7 @@ parameters:
40614031
path: src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
40624032

40634033
-
4064-
message: "#^Parameter \\#2 \\.\\.\\.\\$(args|arrays) of function array_merge expects array, float given\\.$#"
4034+
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, float given\\.$#"
40654035
count: 1
40664036
path: src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
40674037

@@ -4361,7 +4331,7 @@ parameters:
43614331
path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php
43624332

43634333
-
4364-
message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, string\\|null given\\.$#"
4334+
message: "#^Parameter \\#2 \\$str of function explode expects string, string\\|null given\\.$#"
43654335
count: 1
43664336
path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php
43674337

@@ -4486,7 +4456,7 @@ parameters:
44864456
path: src/PhpSpreadsheet/Worksheet/PageSetup.php
44874457

44884458
-
4489-
message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, string\\|null given\\.$#"
4459+
message: "#^Parameter \\#2 \\$str of function explode expects string, string\\|null given\\.$#"
44904460
count: 5
44914461
path: src/PhpSpreadsheet/Worksheet/PageSetup.php
44924462

@@ -4581,7 +4551,7 @@ parameters:
45814551
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
45824552

45834553
-
4584-
message: "#^Parameter \\#1 \\$(input|array) of function array_splice expects array, ArrayObject\\<int, PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\> given\\.$#"
4554+
message: "#^Parameter \\#1 \\$input of function array_splice expects array, ArrayObject\\<int, PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\> given\\.$#"
45854555
count: 1
45864556
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
45874557

@@ -4606,7 +4576,7 @@ parameters:
46064576
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
46074577

46084578
-
4609-
message: "#^Parameter \\#2 \\$(start|offset) of function substr expects int, int(\\<0, max\\>)?\\|false given\\.$#"
4579+
message: "#^Parameter \\#2 \\$start of function substr expects int, int\\<0, max\\>\\|false given\\.$#"
46104580
count: 2
46114581
path: src/PhpSpreadsheet/Worksheet/Worksheet.php
46124582

@@ -4931,12 +4901,12 @@ parameters:
49314901
path: src/PhpSpreadsheet/Writer/Html.php
49324902

49334903
-
4934-
message: "#^Parameter \\#1 \\$im(age)? of function imagepng expects (GdImage|resource), GdImage\\|resource given\\.$#"
4904+
message: "#^Parameter \\#1 \\$im of function imagepng expects resource, GdImage\\|resource given\\.$#"
49354905
count: 1
49364906
path: src/PhpSpreadsheet/Writer/Html.php
49374907

49384908
-
4939-
message: "#^Parameter \\#1 \\$str(ing)? of function base64_encode expects string, string\\|false given\\.$#"
4909+
message: "#^Parameter \\#1 \\$str of function base64_encode expects string, string\\|false given\\.$#"
49404910
count: 2
49414911
path: src/PhpSpreadsheet/Writer/Html.php
49424912

@@ -5066,12 +5036,12 @@ parameters:
50665036
path: src/PhpSpreadsheet/Writer/Xls.php
50675037

50685038
-
5069-
message: "#^Parameter \\#1 \\$im(age)? of function imagepng expects (GdImage|resource), GdImage\\|resource given\\.$#"
5039+
message: "#^Parameter \\#1 \\$im of function imagepng expects resource, GdImage\\|resource given\\.$#"
50705040
count: 1
50715041
path: src/PhpSpreadsheet/Writer/Xls.php
50725042

50735043
-
5074-
message: "#^Parameter \\#1 \\$im(age)? of function imagepng expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#"
5044+
message: "#^Parameter \\#1 \\$im of function imagepng expects resource, resource\\|false given\\.$#"
50755045
count: 1
50765046
path: src/PhpSpreadsheet/Writer/Xls.php
50775047

@@ -5256,7 +5226,7 @@ parameters:
52565226
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52575227

52585228
-
5259-
message: "#^Parameter \\#1 \\$im(age)? of function imagecolorat expects (GdImage|resource), GdImage\\|resource given\\.$#"
5229+
message: "#^Parameter \\#1 \\$im of function imagecolorat expects resource, GdImage\\|resource given\\.$#"
52605230
count: 1
52615231
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52625232

@@ -5271,12 +5241,12 @@ parameters:
52715241
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52725242

52735243
-
5274-
message: "#^Parameter \\#2 \\$col(or)? of function imagecolorsforindex expects int, int\\|false given\\.$#"
5244+
message: "#^Parameter \\#2 \\$col of function imagecolorsforindex expects int, int\\|false given\\.$#"
52755245
count: 1
52765246
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52775247

52785248
-
5279-
message: "#^Parameter \\#2 \\$(data|string) of function unpack expects string, string\\|false given\\.$#"
5249+
message: "#^Parameter \\#2 \\$data of function unpack expects string, string\\|false given\\.$#"
52805250
count: 1
52815251
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52825252

@@ -5286,7 +5256,7 @@ parameters:
52865256
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52875257

52885258
-
5289-
message: "#^Parameter \\#2 \\$(pieces|array) of function implode expects array(\\|null)?, array\\<int, string\\>\\|false given\\.$#"
5259+
message: "#^Parameter \\#2 \\$pieces of function implode expects array, array\\<int, string\\>\\|false given\\.$#"
52905260
count: 1
52915261
path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php
52925262

@@ -5371,7 +5341,7 @@ parameters:
53715341
path: src/PhpSpreadsheet/Writer/Xlsx.php
53725342

53735343
-
5374-
message: "#^Parameter \\#1 \\$(function|callback) of function call_user_func expects callable\\(\\)\\: mixed, string given\\.$#"
5344+
message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, string given\\.$#"
53755345
count: 1
53765346
path: src/PhpSpreadsheet/Writer/Xlsx.php
53775347

0 commit comments

Comments
 (0)