diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 324e8d62f7..57c991754b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15140,6 +15140,11 @@ parameters: count: 2 path: tests/end-to-end/TestBase.php + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 2 + path: tests/end-to-end/TestBase.php + - message: "#^Only booleans are allowed in a negated boolean, int\\|false given\\.$#" count: 1 @@ -15155,11 +15160,6 @@ parameters: count: 1 path: tests/end-to-end/TestBase.php - - - message: "#^Only booleans are allowed in an if condition, int given\\.$#" - count: 2 - path: tests/end-to-end/TestBase.php - - message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" count: 2 diff --git a/tests/end-to-end/TestBase.php b/tests/end-to-end/TestBase.php index fcd6821b53..66cf3d0e87 100644 --- a/tests/end-to-end/TestBase.php +++ b/tests/end-to-end/TestBase.php @@ -22,7 +22,6 @@ use PHPUnit\Framework\TestCase; use Throwable; use function bin2hex; -use function curl_close; use function curl_errno; use function curl_error; use function curl_exec; @@ -1139,11 +1138,11 @@ JS; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_exec($ch); - if (curl_errno($ch)) { - echo 'Error: ' . curl_error($ch) . "\n"; + if (! curl_errno($ch)) { + return; } - curl_close($ch); + echo 'Error: ' . curl_error($ch) . "\n"; } private function getErrorVideoUrl(): void @@ -1173,11 +1172,11 @@ JS; echo 'Test failed, get more information here: ' . $proj->automation_session->public_url . "\n"; } - if (curl_errno($ch)) { - echo 'Error: ' . curl_error($ch) . "\n"; + if (! curl_errno($ch)) { + return; } - curl_close($ch); + echo 'Error: ' . curl_error($ch) . "\n"; } /**