Code Duplication    Length = 10-10 lines in 2 locations

src/AppBundle/Validator/Constraints/DateRangeValidator.php 2 locations

@@ 57-66 (lines=10) @@
54
        }
55
56
        // evaluate now
57
        if (null !== $constraint->min) {
58
            $dateMin = new \DateTime($constraint->min);
59
60
            if ($value < $dateMin) {
61
                $this->addViolation($constraint->minMessage, array(
62
                    '{{ value }}' => $this->formatDate($value),
63
                    '{{ limit }}' => $this->formatDate($dateMin)
64
                ));
65
            }
66
        }
67
68
        if (null !== $constraint->max) {
69
            $dateMax = new \DateTime($constraint->max);
@@ 68-77 (lines=10) @@
65
            }
66
        }
67
68
        if (null !== $constraint->max) {
69
            $dateMax = new \DateTime($constraint->max);
70
71
            if ($value > $dateMax) {
72
                $this->addViolation($constraint->maxMessage, array(
73
                    '{{ value }}' => $this->formatDate($value),
74
                    '{{ limit }}' => $this->formatDate($dateMax)
75
                ));
76
            }
77
        }
78
    }
79
80
    protected function formatDate($date)