Skip to content

Commit 4acccdf

Browse files
author
Florian Krämer
committed
Adding Symfony 6
1 parent 0e6496c commit 4acccdf

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"description": "Symfony bundle for the Problem Details for HTTP APIs RFC",
55
"require": {
66
"php": "^8.2",
7-
"symfony/http-kernel": "~7.0|~6.0",
8-
"symfony/serializer": "~7.0|~6.0",
9-
"symfony/uid": "~7.0|~6.0",
10-
"symfony/validator": "~7.0|~6.0"
7+
"symfony/http-kernel": "~7.0 || ~6.0",
8+
"symfony/serializer": "~7.0 || ~6.0",
9+
"symfony/uid": "~7.0 || ~6.0",
10+
"symfony/validator": "~7.0 || ~6.0"
1111
},
1212
"require-dev": {
1313
"infection/infection": "^0.29.10",
1414
"phpmd/phpmd": "^2.5",
1515
"phpstan/phpstan": "^2.0",
1616
"phpunit/phpunit": "^11.5.0",
1717
"squizlabs/php_codesniffer": "^3.7.2",
18-
"symfony/yaml": "^7.2|^6.0"
18+
"symfony/yaml": "^7.2 || ^6.0"
1919
},
2020
"license": "MIT",
2121
"autoload": {

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ProblemDetailsResponse.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Phauthentic\Symfony\ProblemDetails;
66

77
use InvalidArgumentException;
8-
use LogicException;
98
use Symfony\Component\HttpFoundation\JsonResponse;
109

1110
/**
@@ -61,9 +60,9 @@ public static function create(
6160
}
6261

6362
return new self(
64-
array_merge($data, $extensions),
65-
$status,
66-
[
63+
data: array_merge($data, $extensions),
64+
status: $status,
65+
headers: [
6766
'Content-Type' => self::$contentType
6867
]
6968
);
@@ -90,7 +89,7 @@ public static function assertReservedResponseFields(array $extensions): void
9089
protected static function assertValidStatusCode(int $statusCode): void
9190
{
9291
if (!($statusCode >= 400 && $statusCode < 500) && !($statusCode >= 500 && $statusCode < 600)) {
93-
throw new LogicException(sprintf(
92+
throw new InvalidArgumentException(sprintf(
9493
'Invalid status code %s provided for a Problem Details response. '
9594
. 'Status code must be a client (4xx) or server error (5xx) status code.',
9695
$statusCode

0 commit comments

Comments
 (0)