Skip to content

Commit 35b42cc

Browse files
authored
Phpstan Baseline Fixes 2022-09-21 (#3080)
* Phpstan Baseline Fixes 2022-09-21 Eliminate about 200 more lines from Phpstan baseline. For Helper/Sample and Helper/Html and others, many properties are declared as protected despite the fact that the classes do not extend any other class, and there are no classes which extend them. They are changed to private; this could be a breaking change in circumstances for which I cannot think of a use case (user extends class for some reason). * Slightly Botched Merge Commit Hope this fixes phpstan.
1 parent b8201a7 commit 35b42cc

File tree

13 files changed

+201
-301
lines changed

13 files changed

+201
-301
lines changed

phpstan-baseline.neon

Lines changed: 2 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,156 +1110,6 @@ parameters:
11101110
count: 2
11111111
path: src/PhpSpreadsheet/DefinedName.php
11121112

1113-
-
1114-
message: "#^Cannot call method setBold\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1115-
count: 1
1116-
path: src/PhpSpreadsheet/Helper/Html.php
1117-
1118-
-
1119-
message: "#^Cannot call method setColor\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1120-
count: 1
1121-
path: src/PhpSpreadsheet/Helper/Html.php
1122-
1123-
-
1124-
message: "#^Cannot call method setItalic\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1125-
count: 1
1126-
path: src/PhpSpreadsheet/Helper/Html.php
1127-
1128-
-
1129-
message: "#^Cannot call method setName\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1130-
count: 1
1131-
path: src/PhpSpreadsheet/Helper/Html.php
1132-
1133-
-
1134-
message: "#^Cannot call method setSize\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1135-
count: 1
1136-
path: src/PhpSpreadsheet/Helper/Html.php
1137-
1138-
-
1139-
message: "#^Cannot call method setStrikethrough\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1140-
count: 1
1141-
path: src/PhpSpreadsheet/Helper/Html.php
1142-
1143-
-
1144-
message: "#^Cannot call method setSubscript\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1145-
count: 1
1146-
path: src/PhpSpreadsheet/Helper/Html.php
1147-
1148-
-
1149-
message: "#^Cannot call method setSuperscript\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1150-
count: 1
1151-
path: src/PhpSpreadsheet/Helper/Html.php
1152-
1153-
-
1154-
message: "#^Cannot call method setUnderline\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#"
1155-
count: 1
1156-
path: src/PhpSpreadsheet/Helper/Html.php
1157-
1158-
-
1159-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:startFontTag\\(\\) has parameter \\$tag with no type specified\\.$#"
1160-
count: 1
1161-
path: src/PhpSpreadsheet/Helper/Html.php
1162-
1163-
-
1164-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$bold has no type specified\\.$#"
1165-
count: 1
1166-
path: src/PhpSpreadsheet/Helper/Html.php
1167-
1168-
-
1169-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$color has no type specified\\.$#"
1170-
count: 1
1171-
path: src/PhpSpreadsheet/Helper/Html.php
1172-
1173-
-
1174-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$colourMap has no type specified\\.$#"
1175-
count: 1
1176-
path: src/PhpSpreadsheet/Helper/Html.php
1177-
1178-
-
1179-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$endTagCallbacks has no type specified\\.$#"
1180-
count: 1
1181-
path: src/PhpSpreadsheet/Helper/Html.php
1182-
1183-
-
1184-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$face has no type specified\\.$#"
1185-
count: 1
1186-
path: src/PhpSpreadsheet/Helper/Html.php
1187-
1188-
-
1189-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$italic has no type specified\\.$#"
1190-
count: 1
1191-
path: src/PhpSpreadsheet/Helper/Html.php
1192-
1193-
-
1194-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$size has no type specified\\.$#"
1195-
count: 1
1196-
path: src/PhpSpreadsheet/Helper/Html.php
1197-
1198-
-
1199-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$stack has no type specified\\.$#"
1200-
count: 1
1201-
path: src/PhpSpreadsheet/Helper/Html.php
1202-
1203-
-
1204-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$startTagCallbacks has no type specified\\.$#"
1205-
count: 1
1206-
path: src/PhpSpreadsheet/Helper/Html.php
1207-
1208-
-
1209-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$strikethrough has no type specified\\.$#"
1210-
count: 1
1211-
path: src/PhpSpreadsheet/Helper/Html.php
1212-
1213-
-
1214-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$stringData has no type specified\\.$#"
1215-
count: 1
1216-
path: src/PhpSpreadsheet/Helper/Html.php
1217-
1218-
-
1219-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$subscript has no type specified\\.$#"
1220-
count: 1
1221-
path: src/PhpSpreadsheet/Helper/Html.php
1222-
1223-
-
1224-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$superscript has no type specified\\.$#"
1225-
count: 1
1226-
path: src/PhpSpreadsheet/Helper/Html.php
1227-
1228-
-
1229-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:\\$underline has no type specified\\.$#"
1230-
count: 1
1231-
path: src/PhpSpreadsheet/Helper/Html.php
1232-
1233-
-
1234-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Sample\\:\\:getSamples\\(\\) should return array\\<array\\<string\\>\\> but returns array\\<string, array\\<string, array\\|string\\>\\>\\.$#"
1235-
count: 1
1236-
path: src/PhpSpreadsheet/Helper/Sample.php
1237-
1238-
-
1239-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Sample\\:\\:log\\(\\) has parameter \\$message with no type specified\\.$#"
1240-
count: 1
1241-
path: src/PhpSpreadsheet/Helper/Sample.php
1242-
1243-
-
1244-
message: "#^Parameter \\#1 \\$directory of class RecursiveDirectoryIterator constructor expects string, string\\|false given\\.$#"
1245-
count: 1
1246-
path: src/PhpSpreadsheet/Helper/Sample.php
1247-
1248-
-
1249-
message: "#^Parameter \\#1 \\$filename of function unlink expects string, string\\|false given\\.$#"
1250-
count: 1
1251-
path: src/PhpSpreadsheet/Helper/Sample.php
1252-
1253-
-
1254-
message: "#^Parameter \\#1 \\$path of function pathinfo expects string, array\\|string given\\.$#"
1255-
count: 1
1256-
path: src/PhpSpreadsheet/Helper/Sample.php
1257-
1258-
-
1259-
message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, string\\|false given\\.$#"
1260-
count: 1
1261-
path: src/PhpSpreadsheet/Helper/Sample.php
1262-
12631113
-
12641114
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\IOFactory\\:\\:createReader\\(\\) should return PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\IReader but returns object\\.$#"
12651115
count: 1
@@ -1619,47 +1469,12 @@ parameters:
16191469
message: "#^Unreachable statement \\- code above always terminates\\.$#"
16201470
count: 8
16211471
path: src/PhpSpreadsheet/Reader/Xls.php
1622-
1623-
-
1624-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\Color\\\\BIFF5\\:\\:\\$map has no type specified\\.$#"
1625-
count: 1
1626-
path: src/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php
1627-
1628-
-
1629-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\Color\\\\BIFF8\\:\\:\\$map has no type specified\\.$#"
1630-
count: 1
1631-
path: src/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php
1632-
1633-
-
1634-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\Color\\\\BuiltIn\\:\\:\\$map has no type specified\\.$#"
1635-
count: 1
1636-
path: src/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php
1637-
1638-
-
1639-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\ErrorCode\\:\\:\\$map has no type specified\\.$#"
1640-
count: 1
1641-
path: src/PhpSpreadsheet/Reader/Xls/ErrorCode.php
1642-
1643-
-
1644-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\RC4\\:\\:\\$i has no type specified\\.$#"
1645-
count: 1
1646-
path: src/PhpSpreadsheet/Reader/Xls/RC4.php
1647-
1648-
-
1649-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\RC4\\:\\:\\$j has no type specified\\.$#"
1650-
count: 1
1651-
path: src/PhpSpreadsheet/Reader/Xls/RC4.php
1652-
1653-
-
1654-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\RC4\\:\\:\\$s has no type specified\\.$#"
1655-
count: 1
1656-
path: src/PhpSpreadsheet/Reader/Xls/RC4.php
1657-
1472+
16581473
-
16591474
message: "#^Cannot access property \\$r on SimpleXMLElement\\|null\\.$#"
16601475
count: 2
16611476
path: src/PhpSpreadsheet/Reader/Xlsx.php
1662-
1477+
16631478
-
16641479
message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#"
16651480
count: 1
@@ -2145,11 +1960,6 @@ parameters:
21451960
count: 1
21461961
path: src/PhpSpreadsheet/Shared/OLERead.php
21471962

2148-
-
2149-
message: "#^Static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\TimeZone\\:\\:validateTimeZone\\(\\) is unused\\.$#"
2150-
count: 1
2151-
path: src/PhpSpreadsheet/Shared/TimeZone.php
2152-
21531963
-
21541964
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\BestFit\\:\\:calculateGoodnessOfFit\\(\\) has parameter \\$const with no type specified\\.$#"
21551965
count: 1

samples/Calculations/Financial/FV.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
$helper->log($worksheet->getCell('B8')->getValue());
3333
$helper->log('FV() Result is ' . $worksheet->getCell('B8')->getFormattedValue());
3434

35-
$helper->log($worksheet->getCell('C6')->getValue());
35+
$helper->log($worksheet->getCell('C8')->getValue());
3636
$helper->log('FV() Result is ' . $worksheet->getCell('C8')->getFormattedValue());

0 commit comments

Comments
 (0)