Skip to content

Commit b93a766

Browse files
Messy changes for phpstan... when we drop support for PHP 7, we can tidy with the nullsafe operator :)
1 parent 678dd17 commit b93a766

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

phpstan.neon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
parameters:
22
paths:
33
- src
4-
level: 8
4+
level: 8
5+
ignoreErrors:
6+
- '#Call to an undefined method object::mustRun\(\).#'

src/Browserless.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,10 @@ private function render(array $options)
240240
'json' => $options,
241241
]);
242242
} catch (\GuzzleHttp\Exception\ClientException $e) {
243-
$body = $e->getResponse()->getBody();
244-
$json = json_decode($body);
245-
$message = $e->getResponse()->getBody();
243+
$response = $e->getResponse();
244+
$body = $response ? $response->getBody() : '';
245+
$json = $response ? json_decode($body) : '';
246+
$message = $body;
246247
if (json_last_error() === JSON_ERROR_NONE) {
247248
$messages = [];
248249
foreach ($json as $error) {

0 commit comments

Comments
 (0)