EqualToConstraintValidator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
ccs 4
cts 4
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 6 1
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of FlexPHP.
4
 *
5
 * (c) Freddie Gar <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace FlexPHP\Schema\Validators\Constraints;
11
12
use Symfony\Component\Validator\Constraints\NotBlank;
13
use Symfony\Component\Validator\ConstraintViolationListInterface;
14
use Symfony\Component\Validator\Validation;
15
16
/**
17
 * @Annotation
18
 */
19
class EqualToConstraintValidator
20
{
21
    /**
22
     * @param string $string
23
     */
24 7
    public function validate($string): ConstraintViolationListInterface
25
    {
26 7
        $validator = Validation::createValidator();
27
28 7
        return $validator->validate($string, [
29 7
            new NotBlank(),
30
        ]);
31
    }
32
}
33