Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Downloader/Middleware/ExecuteJavascriptMiddleware.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,8 @@
private LoggerInterface $logger,
?callable $getBrowsershot = null,
) {
$this->getBrowsershot = $getBrowsershot ?? static fn (string $uri): Browsershot => Browsershot::url($uri)->waitUntilNetworkIdle();
/** @psalm-suppress MixedInferredReturnType, MixedReturnStatement */
$this->getBrowsershot = $getBrowsershot ?? static fn (string $uri): Browsershot => Browsershot::url($uri);
}

public function handleResponse(Response $response): Response
Expand DownExpand Up@@ -64,6 +65,10 @@
{
$browsershot = ($this->getBrowsershot)($uri);

if (null !== ($waitUntilNetworkIdle = $this->option('waitUntilNetworkIdle'))) {
$browsershot->waitUntilNetworkIdle($waitUntilNetworkIdle);

Check failure on line 69 in src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

View workflow job for this annotation

GitHub Actions/ P8.3 - prefer-stable - ubuntu-latest

Parameter #1 $strict of method Spatie\Browsershot\Browsershot::waitUntilNetworkIdle() expects bool, mixed given.

Check failure on line 69 in src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

View workflow job for this annotation

GitHub Actions/ P8.3 - prefer-lowest - ubuntu-latest

Parameter #1 $strict of method Spatie\Browsershot\Browsershot::waitUntilNetworkIdle() expects bool, mixed given.

Check failure on line 69 in src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

View workflow job for this annotation

GitHub Actions/ P8.2 - prefer-stable - ubuntu-latest

Parameter #1 $strict of method Spatie\Browsershot\Browsershot::waitUntilNetworkIdle() expects bool, mixed given.

Check failure on line 69 in src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

View workflow job for this annotation

GitHub Actions/ P8.4 - prefer-lowest - ubuntu-latest

Parameter #1 $strict of method Spatie\Browsershot\Browsershot::waitUntilNetworkIdle() expects bool, mixed given.

Check failure on line 69 in src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

View workflow job for this annotation

GitHub Actions/ P8.2 - prefer-lowest - ubuntu-latest

Parameter #1 $strict of method Spatie\Browsershot\Browsershot::waitUntilNetworkIdle() expects bool, mixed given.

Check failure on line 69 in src/Downloader/Middleware/ExecuteJavascriptMiddleware.php

View workflow job for this annotation

GitHub Actions/ P8.4 - prefer-stable - ubuntu-latest

Parameter #1 $strict of method Spatie\Browsershot\Browsershot::waitUntilNetworkIdle() expects bool, mixed given.
}

if (!empty($this->option('chromiumArguments'))) {
/** @phpstan-ignore argument.type */
$browsershot->addChromiumArguments($this->option('chromiumArguments'));
Expand DownExpand Up@@ -115,6 +120,7 @@
private function defaultOptions(): array
{
return [
'waitUntilNetworkIdle' => true,
'chromiumArguments' => [],
'chromePath' => null,
'binPath' => null,
Expand Down
Loading