Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function evaluate(FaceDetectionResult $result, Face $constraint): Evaluation |
||
12 | { |
||
13 | $acceptableLevel = new NoiseLevel($constraint->maxNoiseLevel); |
||
14 | $actualLevel = $result->getNoise()->getLevel(); |
||
15 | |||
16 | if ($actualLevel->isLowerOrEqual($acceptableLevel)) { |
||
17 | return new Evaluation(true); |
||
18 | } |
||
19 | |||
20 | return new Evaluation(false, $constraint->noiseMessage); |
||
21 | } |
||
23 |