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

Commit 1f4776c

Browse files
committed
#40 fixed codestyle/formatting after review
1 parent 41ed22c commit 1f4776c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/ProblemDetailsResponseFactory.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Psr\Http\Message\ServerRequestInterface;
1717
use Spatie\ArrayToXml\ArrayToXml;
1818
use Throwable;
19+
1920
use function array_merge;
2021
use function array_walk_recursive;
2122
use function get_class;
@@ -29,11 +30,12 @@
2930
use function print_r;
3031
use function sprintf;
3132
use function strpos;
33+
34+
use const JSON_PARTIAL_OUTPUT_ON_ERROR;
3235
use const JSON_PRESERVE_ZERO_FRACTION;
3336
use const JSON_PRETTY_PRINT;
3437
use const JSON_UNESCAPED_SLASHES;
3538
use const JSON_UNESCAPED_UNICODE;
36-
use const JSON_PARTIAL_OUTPUT_ON_ERROR;
3739

3840
/**
3941
* Create a Problem Details response.
@@ -215,7 +217,9 @@ public function __construct(
215217
};
216218
$this->isDebug = $isDebug;
217219
if (! $jsonFlags) {
218-
$jsonFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION
220+
$jsonFlags = JSON_UNESCAPED_SLASHES
221+
| JSON_UNESCAPED_UNICODE
222+
| JSON_PRESERVE_ZERO_FRACTION
219223
| JSON_PARTIAL_OUTPUT_ON_ERROR;
220224
if ($isDebug) {
221225
$jsonFlags = JSON_PRETTY_PRINT | $jsonFlags;

test/ProblemDetailsResponseFactoryFactoryTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public function testLackOfConfigServiceResultsInFactoryUsingDefaults() : void
8282
$this->assertInstanceOf(ProblemDetailsResponseFactory::class, $factory);
8383
$this->assertAttributeSame(ProblemDetailsResponseFactory::EXCLUDE_THROWABLE_DETAILS, 'isDebug', $factory);
8484
$this->assertAttributeSame(
85-
JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION
85+
JSON_UNESCAPED_SLASHES
86+
| JSON_UNESCAPED_UNICODE
87+
| JSON_PRESERVE_ZERO_FRACTION
8688
| JSON_PARTIAL_OUTPUT_ON_ERROR,
8789
'jsonFlags',
8890
$factory

test/ProblemDetailsResponseFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public function testRenderWithMalformedUtf8Sequences(): void
444444
$e->getType()->willReturn('https://example.com/api/doc/invalid-client-request');
445445
$e->getAdditionalData()->willReturn([
446446
'malformed-utf8' => self::UTF_8_INVALID_2_OCTET_SEQUENCE,
447-
]);
447+
]);
448448

449449
$this->request->getHeaderLine('Accept')->willReturn('application/json');
450450

0 commit comments

Comments
 (0)