FaceIsOfSufficientSize   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 9
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A evaluate() 0 7 2
1
<?php
2
3
namespace XSolve\FaceValidatorBundle\Validator\Specification;
4
5
use XSolve\FaceValidatorBundle\Result\FaceDetectionResult;
6
use XSolve\FaceValidatorBundle\Validator\Constraints\Face;
7
8
class FaceIsOfSufficientSize implements FaceValidationSpecification
9
{
10
    public function evaluate(FaceDetectionResult $result, Face $constraint): Evaluation
11
    {
12
        if ($result->getFaceToImageRatio() >= $constraint->minFaceRatio) {
13
            return new Evaluation(true);
14
        }
15
16
        return new Evaluation(false, $constraint->faceTooSmallMessage);
17
    }
18
}
19