Code Duplication    Length = 6-8 lines in 2 locations

src/Sensorario/Resources/Validators/Validators/MandatoryConditional.php 2 locations

@@ 29-34 (lines=6) @@
26
27
                if (is_array($propertyValue)) {
28
                    foreach ($propertyValue as $value) {
29
                        if ($resource->get($propertyName) === $value && $resource->hasNotProperty($key)) {
30
                            throw new RuntimeException(
31
                                'When property `' . $key . '` has value '
32
                                . '`' . $value . '` also `' . $key . '` is mandatory'
33
                            );
34
                        }
35
                    }
36
                } else {
37
                    if ($resource->get($propertyName) === $propertyValue && $resource->hasNotProperty($key)) {
@@ 36-43 (lines=8) @@
33
                            );
34
                        }
35
                    }
36
                } else {
37
                    if ($resource->get($propertyName) === $propertyValue && $resource->hasNotProperty($key)) {
38
                        throw new RuntimeException(
39
                            'When property `' . $key . '` has value '
40
                            . '`' . $propertyValue . '` also `' . $key . '` is mandatory'
41
                        );
42
                    }
43
                }
44
            }
45
        }
46
    }