Skip to content

sokil/php-symfony-validator-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-symfony-validator-converter

Installation

Add requirement to composer:

composer require sokil/php-symfony-validator-converter

Add service to app or bundle services config:

acme.validator.error_converter:
  class: Sokil\Converter\ValidationErrorsConverter

Usage

<?php

$errors = $this->get('validator')->validate($entity);
if (count($errors) > 0) {
    $list = $this
        ->get('acme.validator.error_converter')
        ->constraintViolationListToArray($errors);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages