Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function evaluate(FaceDetectionResult $result, Face $constraint): Evaluation |
||
11 | { |
||
12 | $rotation = $result->getRotation(); |
||
13 | |||
14 | foreach ([$rotation->getX(), $rotation->getY(), $rotation->getZ()] as $rotationValue) { |
||
15 | if ($rotationValue > $constraint->maxFaceRotation) { |
||
16 | return new Evaluation(false, $constraint->tooMuchRotatedMessage); |
||
17 | } |
||
18 | } |
||
19 | |||
20 | return new Evaluation(true); |
||
21 | } |
||
23 |