Skip to content

Commit d01ee87

Browse files
committed
fix phpstan
1 parent 2a26047 commit d01ee87

8 files changed

Lines changed: 14 additions & 5 deletions

File tree

system/Common.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function clean_path(string $path): string
121121
*
122122
* @return false|string
123123
*/
124+
// @phpstan-ignore return.unusedType (The executed command may change the output buffer level.)
124125
function command(string $command)
125126
{
126127
$regexString = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';

tests/system/CommonFunctionsSendTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function testRedirectResponseCookiesSent(): void
5858
// send it
5959
ob_start();
6060
$response->send();
61+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
6162
if (ob_get_level() > 0) {
6263
ob_end_clean();
6364
}

tests/system/HTTP/DownloadResponseTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ public function testRealOutput(): void
377377
// send it
378378
ob_start();
379379
$response->send();
380+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
380381
if (ob_get_level() > 0) {
381382
ob_end_clean();
382383
}

tests/system/HTTP/ResponseSendTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function testHeadersMissingDate(): void
6767
// send it
6868
ob_start();
6969
$response->send();
70+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
7071
if (ob_get_level() > 0) {
7172
ob_end_clean();
7273
}
@@ -102,6 +103,7 @@ public function testHeadersWithCSP(): void
102103
// send it
103104
ob_start();
104105
$response->send();
106+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
105107
if (ob_get_level() > 0) {
106108
ob_end_clean();
107109
}
@@ -140,6 +142,7 @@ public function testRedirectResponseCookies(): void
140142
// send it
141143
ob_start();
142144
$response->send();
145+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
143146
if (ob_get_level() > 0) {
144147
ob_end_clean();
145148
}
@@ -213,6 +216,7 @@ public function testHeaderOverride(): void
213216
header('Access-Control-Expose-Headers: Content-Encoding');
214217
header('Allow: GET, POST');
215218
$response->send();
219+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
216220
if (ob_get_level() > 0) {
217221
ob_end_clean();
218222
}

tests/system/Test/BootstrapFCPATHTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private function fileContents(): string
100100
return $fileContents . 'echo FCPATH;' . PHP_EOL;
101101
}
102102

103-
private function readOutput(string $file): false|string
103+
private function readOutput(string $file): string
104104
{
105105
ob_start();
106106
system('php -f ' . $file);

tests/system/Test/TestCaseEmissionsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function testHeadersEmitted(): void
6262
// send it
6363
ob_start();
6464
$response->send();
65+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
6566
if (ob_get_level() > 0) {
6667
ob_end_clean();
6768
}
@@ -90,6 +91,7 @@ public function testHeadersNotEmitted(): void
9091
// send it
9192
ob_start();
9293
$response->send(); // what really was sent
94+
// @phpstan-ignore greater.alwaysTrue (The response may change the output buffer level.)
9395
if (ob_get_level() > 0) {
9496
ob_end_clean();
9597
}

utils/phpstan-baseline/loader.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 1825 errors
1+
# total 1827 errors
22

33
includes:
44
- argument.type.neon

utils/phpstan-baseline/method.notFound.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 78 errors
1+
# total 80 errors
22

33
parameters:
44
ignoreErrors:
@@ -69,7 +69,7 @@ parameters:
6969

7070
-
7171
message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getGetPost\(\)\.$#'
72-
count: 5
72+
count: 6
7373
path: ../../tests/system/HTTP/IncomingRequestTest.php
7474

7575
-
@@ -89,7 +89,7 @@ parameters:
8989

9090
-
9191
message: '#^Call to an undefined method CodeIgniter\\HTTP\\Request\:\:getPostGet\(\)\.$#'
92-
count: 5
92+
count: 6
9393
path: ../../tests/system/HTTP/IncomingRequestTest.php
9494

9595
-

0 commit comments

Comments
 (0)