Validator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 17
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A cif() 0 3 1
A validate() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ByTIC\Validator\Utility;
6
7
use ByTIC\Validator\Constraints\Cif;
8
use Symfony\Component\Validator\Validation;
9
10
/**
11
 * Class Validator.
12
 */
13
class Validator
14
{
15
    public static function cif($value): \Symfony\Component\Validator\ConstraintViolationListInterface
16
    {
17
        return self::validate($value, new Cif());
18
    }
19
20
    /**
21
     * @return \Symfony\Component\Validator\ConstraintViolationListInterface
22
     */
23
    protected static function validate($value, $constraints)
24
    {
25
        $validator = Validation::createValidator();
26
27
        return $validator->validate(
28
            $value,
29
            $constraints
30
        );
31
    }
32
}
33