Skip to content

Commit 2aec066

Browse files
committed
fix: fix psalm errors on latest release
1 parent c9d7d46 commit 2aec066

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
?callable $getBrowsershot = null,
3737
) {
3838
/** @psalm-suppress MixedInferredReturnType, MixedReturnStatement */
39-
$this->getBrowsershot = $getBrowsershot ?: static fn (string $uri): Browsershot => Browsershot::url($uri)->waitUntilNetworkIdle();
39+
$this->getBrowsershot = $getBrowsershot ?? static fn (string $uri): Browsershot => Browsershot::url($uri)->waitUntilNetworkIdle();
4040
}
4141

4242
public function handleResponse(Response $response): Response

src/Downloader/Middleware/RobotsTxtMiddleware.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ private function createRobotsUrl(string $url): string
5353
{
5454
$robotsUrl = \parse_url($url, PHP_URL_SCHEME) . '://' . \parse_url($url, PHP_URL_HOST);
5555

56-
if ($port = \parse_url($url, PHP_URL_PORT)) {
56+
$port = \parse_url($url, PHP_URL_PORT);
57+
if ($port !== null && $port !== false) {
5758
$robotsUrl .= ":{$port}";
5859
}
5960

src/Http/FakeClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function pool(array $requests, ?callable $onFulfilled = null, ?callable $
3131
foreach ($requests as $request) {
3232
$this->sentRequestUrls[] = $request->getUri();
3333

34-
if ($onFulfilled) {
34+
if ($onFulfilled !== null) {
3535
$response = new Response(new GuzzleResponse(), $request);
3636

3737
$onFulfilled($response);

0 commit comments

Comments
 (0)