Skip to content

Commit 964d722

Browse files
committed
Re-run Rector
1 parent 57a57c3 commit 964d722

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/HeroFunction.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use ArrayLookup\AtLeast;
88
use Seld\JsonLint\JsonParser;
9+
use Seld\JsonLint\ParsingException;
910
use Throwable;
1011

1112
use function is_array;
@@ -14,9 +15,9 @@
1415
function detectMessageContentType(string $message): string
1516
{
1617
$jsonParser = new JsonParser();
17-
return $jsonParser->lint($message) === null
18-
? 'application/problem+json'
19-
: (strip_tags($message) === $message ? 'text/plain' : 'text/html');
18+
return $jsonParser->lint($message) instanceof ParsingException
19+
? (strip_tags($message) === $message ? 'text/plain' : 'text/html')
20+
: 'application/problem+json';
2021
}
2122

2223
/**

src/Middleware/Mezzio.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function exceptionError(Throwable $throwable): Response
9595

9696
private function showDefaultView(): Response|HtmlResponse
9797
{
98-
if ($this->templateRenderer === null) {
98+
if (! $this->templateRenderer instanceof TemplateRendererInterface) {
9999
return $this->responseByConfigMessage('no_template');
100100
}
101101

0 commit comments

Comments
 (0)