Passed
Push — master ( 641a53...544fde )
by Giancarlos
02:24
created

VoidedValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 4
dl 0
loc 12
ccs 0
cts 9
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadValidatorMetadata() 0 9 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Administrador
5
 * Date: 18/07/2017
6
 * Time: 01:20 PM
7
 */
8
9
namespace Greenter\Xml\Validator;
10
11
use Symfony\Component\Validator\Mapping\ClassMetadata;
12
use Symfony\Component\Validator\Constraints as Assert;
13
14
/**
15
 * Trait VoidedValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait VoidedValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraint('fecGeneracion', new Assert\Date());
23
        $metadata->addPropertyConstraints('fecComunicacion', [
24
            new Assert\NotBlank(),
25
            new Assert\Date(),
26
        ]);
27
        $metadata->addPropertyConstraint('documents', new Assert\Valid());
28
    }
29
}