for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: Administrador
* Date: 18/07/2017
* Time: 01:21 PM
*/
namespace Greenter\Xml\Validator;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
* Trait VoidedDetailValidator
* @package Greenter\Xml\Validator
trait VoidedDetailValidator
{
public static function loadValidatorMetadata(ClassMetadata $metadata)
$metadata->addPropertyConstraints('tipoDoc', [
new Assert\NotBlank(),
new Assert\Length([
'min' => 2,
'max' => 2,
]),
]);
$metadata->addPropertyConstraints('serie', [
'min' => 4,
'max' => 4,
$metadata->addPropertyConstraints('correlativo', [
new Assert\Length(['max' => 8]),
$metadata->addPropertyConstraints('desMotivoBaja', [
new Assert\Length(['max' => 100]),
}