Failed Conditions
Push — issue#666 ( 82e9d5...91903a )
by Guilherme
08:00
created

IdCardValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A validate() 0 3 1
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\ValidationControlBundle\Validator\Constraints;
12
13
use Symfony\Component\Validator\ConstraintValidator;
14
use Symfony\Component\Validator\Constraint;
15
use LoginCidadao\ValidationControlBundle\Handler\ValidationHandler;
16
17
/**
18
 * @Annotation
19
 */
20
class IdCardValidator extends ConstraintValidator
21
{
22
    /** @var ValidationHandler */
23
    private $handler;
24
25
    public function __construct(ValidationHandler $handler)
26
    {
27
        $this->handler = $handler;
28
    }
29
30
    public function validate($value, Constraint $constraint)
31
    {
32
        $this->handler->idCardValidate($this->context, $constraint, $value);
33
    }
34
}
35