Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 978c31b

Browse files
samsonasikweierophinney
authored andcommitted
supply JSON_PRETTY_PRINT only on debug mode
1 parent fff24df commit 978c31b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ProblemDetailsResponseFactory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,13 @@ public function __construct(
191191
return $responseFactory();
192192
};
193193
$this->isDebug = $isDebug;
194-
$this->jsonFlags = $jsonFlags
195-
?: JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION;
194+
if (! $jsonFlags) {
195+
$jsonFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION;
196+
if ($isDebug) {
197+
$jsonFlags = JSON_PRETTY_PRINT | $jsonFlags;
198+
}
199+
}
200+
$this->jsonFlags = $jsonFlags;
196201
$this->exceptionDetailsInResponse = $exceptionDetailsInResponse;
197202
$this->defaultDetailMessage = $defaultDetailMessage;
198203
}

0 commit comments

Comments
 (0)