Test Failed
Push — develop ( cc6a8c...2132bf )
by Freddie
15:51
created

MaxConstraintValidator::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace FlexPHP\Generator\Domain\Validators\Constraints;
4
5
use Symfony\Component\Validator\Constraints\NotBlank;
6
use Symfony\Component\Validator\Constraints\Positive;
7
use Symfony\Component\Validator\Validation;
8
9
/**
10
 * @Annotation
11
 */
12
class MaxConstraintValidator
13
{
14
    public function validate($max)
15
    {
16
        $validator = Validation::createValidator();
17
18
        return $validator->validate($max, [
19
            new NotBlank(),
20
            new Positive(),
21
        ]);
22
    }
23
}
24