issues/27: old meta with pagination and trait and more

This commit is contained in:
Valery Petrov
2026-05-15 14:08:47 +03:00
committed by Valeriy Petrov
parent bc5468e5a0
commit 656f79ff4e
10 changed files with 90 additions and 29 deletions
+6 -3
View File
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Service\Crud;
use Doctrine\ORM\EntityManagerInterface;
use JsonException;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -142,9 +143,11 @@ final class CrudResponder
*/
private function decodePayload(Request $request): ?array
{
$data = json_decode($request->getContent(), true);
return is_array($data) ? $data : null;
try {
return $request->toArray();
} catch (JsonException) {
return null;
}
}
private function validate(object $entity): ?JsonResponse