Skip to content

Commit 2676692

Browse files
authored
Remove error response implementation
1 parent ffd1849 commit 2676692

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/RequestObject.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Symfony\Component\Validator\ConstraintViolation;
88
use Symfony\Component\Validator\ConstraintViolationListInterface;
99

10-
class RequestObject implements ErrorResponseProvider
10+
class RequestObject
1111
{
1212
private $payload;
1313

@@ -59,20 +59,4 @@ public function all()
5959
{
6060
return $this->payload;
6161
}
62-
63-
/**
64-
* @param ConstraintViolationListInterface $errors
65-
*
66-
* @return JsonResponse|\Symfony\Component\HttpFoundation\Response
67-
*/
68-
public function getErrorResponse(ConstraintViolationListInterface $errors)
69-
{
70-
return new JsonResponse([
71-
'errors' => array_map(function (ConstraintViolation $violation) {
72-
return [
73-
$violation->getPropertyPath() => $violation->getMessage(),
74-
];
75-
}, iterator_to_array($errors))
76-
], 422);
77-
}
7862
}

0 commit comments

Comments
 (0)