use DigitalRevolution\SymfonyRequestValidation\AbstractValidatedRequest;
use DigitalRevolution\SymfonyRequestValidation\ValidationRules;
class ExampleRequest extends AbstractValidatedRequest
{
protected function getValidationRules(): ValidationRules
{
return new ValidationRules([
'request' => [
'productId' => '
class ExampleController
{
/**
* @Route("/", name="my_example")
*/
public function index(ExampleRequest $request): Response
{
return ...;
}
}
class ExampleRequest extends AbstractValidatedRequest
{
...
protected function handleViolations(ConstraintViolationListInterface $violationList): void
{
$renderer = new ViolationListRenderer($violationList);
$this->logger->error($renderer->render());
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.