Test Failed
Push — master ( 05d675...f4e7d7 )
by Giancarlos
04:02
created

VoidedDetailValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 28
ccs 0
cts 24
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B loadValidatorMetadata() 0 25 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Administrador
5
 * Date: 18/07/2017
6
 * Time: 01:21 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 VoidedDetailValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait VoidedDetailValidator
19
{
20
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22
        $metadata->addPropertyConstraints('tipoDoc', [
23
            new Assert\NotBlank(),
24
            new Assert\Length([
25
                'min' => 2,
26
                'max' => 2,
27
            ]),
28
        ]);
29
        $metadata->addPropertyConstraints('serie', [
30
            new Assert\NotBlank(),
31
            new Assert\Length([
32
                'min' => 4,
33
                'max' => 4,
34
            ]),
35
        ]);
36
        $metadata->addPropertyConstraints('correlativo', [
37
            new Assert\NotBlank(),
38
            new Assert\Length(['max' => 8]),
39
        ]);
40
        $metadata->addPropertyConstraints('desMotivoBaja', [
41
            new Assert\NotBlank(),
42
            new Assert\Length(['max' => 100]),
43
        ]);
44
    }
45
}