Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions library/Pdfexport/HeadlessChrome.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use React\Promise\ExtendedPromiseInterface;
use Throwable;
use WebSocket\Client;
use WebSocket\ConnectionException;

class HeadlessChrome
{
Expand Down Expand Up @@ -191,7 +190,7 @@

foreach ($arguments as $name => $value) {
if ($value !== null) {
$value = escapeshellarg($value);

Check failure on line 193 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $arg of function escapeshellarg expects string, mixed given.

Check failure on line 193 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $arg of function escapeshellarg expects string, mixed given.

Check failure on line 193 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $arg of function escapeshellarg expects string, mixed given.

Check failure on line 193 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $arg of function escapeshellarg expects string, mixed given.

if (! is_int($name)) {
if (substr($name, -1) === '=') {
Expand Down Expand Up @@ -254,9 +253,9 @@
switch (true) {
case $this->remote !== null:
try {
$result = $this->jsonVersion($this->remote[0], $this->remote[1]);

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #2 $port of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects int, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $host of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects string, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #2 $port of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects int, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $host of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects string, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #2 $port of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects int, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $host of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects string, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #2 $port of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects int, mixed given.

Check failure on line 256 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $host of method Icinga\Module\Pdfexport\HeadlessChrome::jsonVersion() expects string, mixed given.
if (is_array($result)) {
$parts = explode('/', $result['webSocketDebuggerUrl']);

Check failure on line 258 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #2 $string of function explode expects string, mixed given.

Check failure on line 258 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #2 $string of function explode expects string, mixed given.

Check failure on line 258 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #2 $string of function explode expects string, mixed given.

Check failure on line 258 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #2 $string of function explode expects string, mixed given.
$pdf = $this->printToPDF(
join(':', $this->remote),
end($parts),
Expand Down Expand Up @@ -330,10 +329,10 @@

$chrome->start();

$chrome->stderr->on('data', function ($chunk) use ($chrome, $deferred, $killer) {

Check failure on line 332 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method on() on React\Stream\ReadableStreamInterface|React\Stream\WritableStreamInterface|null.

Check failure on line 332 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Cannot call method on() on React\Stream\ReadableStreamInterface|React\Stream\WritableStreamInterface|null.

Check failure on line 332 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method on() on React\Stream\ReadableStreamInterface|React\Stream\WritableStreamInterface|null.

Check failure on line 332 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method on() on React\Stream\ReadableStreamInterface|React\Stream\WritableStreamInterface|null.
Logger::debug('Caught browser output: %s', $chunk);

if (preg_match(self::DEBUG_ADDR_PATTERN, trim($chunk), $matches)) {

Check failure on line 335 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Parameter #1 $string of function trim expects string, mixed given.

Check failure on line 335 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Parameter #1 $string of function trim expects string, mixed given.

Check failure on line 335 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Parameter #1 $string of function trim expects string, mixed given.

Check failure on line 335 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Parameter #1 $string of function trim expects string, mixed given.
Loop::cancelTimer($killer);

try {
Expand Down Expand Up @@ -386,7 +385,7 @@
}
});

return $deferred->promise();

Check failure on line 388 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Method Icinga\Module\Pdfexport\HeadlessChrome::asyncToPdf() should return React\Promise\ExtendedPromiseInterface but returns React\Promise\PromiseInterface.

Check failure on line 388 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Method Icinga\Module\Pdfexport\HeadlessChrome::asyncToPdf() should return React\Promise\ExtendedPromiseInterface but returns React\Promise\PromiseInterface.

Check failure on line 388 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Method Icinga\Module\Pdfexport\HeadlessChrome::asyncToPdf() should return React\Promise\ExtendedPromiseInterface but returns React\Promise\PromiseInterface.

Check failure on line 388 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Method Icinga\Module\Pdfexport\HeadlessChrome::asyncToPdf() should return React\Promise\ExtendedPromiseInterface but returns React\Promise\PromiseInterface.
}

/**
Expand Down Expand Up @@ -429,7 +428,7 @@

private function printToPDF($socket, $browserId, array $parameters)
{
$browser = new Client(sprintf('ws://%s/devtools/browser/%s', $socket, $browserId));

Check failure on line 431 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Ignored error pattern #^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$# (argument.type) in path /home/runner/work/icingaweb2-module-pdfexport/icingaweb2-module-pdfexport/library/Pdfexport/HeadlessChrome.php is expected to occur 1 time, but occurred 3 times.

Check failure on line 431 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Ignored error pattern #^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$# (argument.type) in path /home/runner/work/icingaweb2-module-pdfexport/icingaweb2-module-pdfexport/library/Pdfexport/HeadlessChrome.php is expected to occur 1 time, but occurred 3 times.

Check failure on line 431 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Ignored error pattern #^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$# (argument.type) in path /home/runner/work/icingaweb2-module-pdfexport/icingaweb2-module-pdfexport/library/Pdfexport/HeadlessChrome.php is expected to occur 1 time, but occurred 3 times.

Check failure on line 431 in library/Pdfexport/HeadlessChrome.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Ignored error pattern #^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$# (argument.type) in path /home/runner/work/icingaweb2-module-pdfexport/icingaweb2-module-pdfexport/library/Pdfexport/HeadlessChrome.php is expected to occur 1 time, but occurred 3 times.

// Open new tab, get its id
$result = $this->communicate($browser, 'Target.createTarget', [
Expand Down Expand Up @@ -535,7 +534,7 @@

try {
$browser->close();
} catch (ConnectionException $e) {
} catch (Throwable $e) {
// For some reason, the browser doesn't send a response
Logger::debug(sprintf('Failed to close browser connection: ' . $e->getMessage()));
}
Expand Down Expand Up @@ -637,7 +636,7 @@
return $response['result'];
}

private function waitFor(Client $ws, $eventName, array $expectedParams = null)
private function waitFor(Client $ws, $eventName, ?array $expectedParams = null)
{
if ($eventName !== self::WAIT_FOR_NETWORK) {
Logger::debug(
Expand Down
67 changes: 0 additions & 67 deletions patches/iio-libmergepdf-support-php82.patch

This file was deleted.

Loading
Loading