Skip to content

Commit 46a136e

Browse files
authored
Fix deprecation message
Using a string "HTTP_BAD_REQUEST" as a constant of the "Symfony\Component\HttpFoundation\Response" class is deprecated since API Platform 2.1 and will not be possible anymore in API Platform 3. Use the Symfony's custom YAML extension for PHP constants instead (i.e. "!php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST").
1 parent 81acb92 commit 46a136e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ api_platform:
7575
exception_to_status:
7676
# The 4 following handlers are registered by default, keep those lines to prevent unexpected side effects
7777
Symfony\Component\Serializer\Exception\ExceptionInterface: 400 # Use a raw status code (recommended)
78-
ApiPlatform\Core\Exception\InvalidArgumentException: 'HTTP_BAD_REQUEST' # Or a `Symfony\Component\HttpFoundation\Response`'s constant
78+
ApiPlatform\Core\Exception\InvalidArgumentException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
7979
ApiPlatform\Core\Exception\FilterValidationException: 400
8080
Doctrine\ORM\OptimisticLockException: 409
8181

0 commit comments

Comments
 (0)