Completed
Push — master ( 1ed55c...1adee7 )
by Giancarlos
03:47
created

DirectionValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadValidatorMetadata() 0 11 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Giansalex
5
 * Date: 07/08/2017
6
 * Time: 23:59
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 DirectionValidator
16
 * @package Greenter\Xml\Validator
17
 */
18
trait DirectionValidator
19
{
20 6
    public static function loadValidatorMetadata(ClassMetadata $metadata)
21
    {
22 6
        $metadata->addPropertyConstraints('ubigueo', [
23 6
            new Assert\NotBlank(),
24 6
            new Assert\Length(['max' => 8]),
25 6
        ]);
26 6
        $metadata->addPropertyConstraints('direccion', [
27 6
            new Assert\NotBlank(),
28 6
            new Assert\Length(['max' => 100]),
29 6
        ]);
30
    }
31
}