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

IdCardValidator::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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