Code Duplication    Length = 5-5 lines in 4 locations

Service/Validator/AbstractImageValidator.php 4 locations

@@ 76-80 (lines=5) @@
73
     */
74
    protected function isValid($width, $height, array $configuration)
75
    {
76
        if (isset($configuration['MinWidth']) && $this->validateConfig('MinWidth', $configuration)) {
77
            if ($width < $configuration['MinWidth']) {
78
                throw new ValidationException('Minimum width must be '.$configuration['MinWidth'].'px');
79
            }
80
        }
81
82
        if (isset($configuration['MaxWidth']) && $this->validateConfig('MaxWidth', $configuration)) {
83
            if ($width > $configuration['MaxWidth']) {
@@ 82-86 (lines=5) @@
79
            }
80
        }
81
82
        if (isset($configuration['MaxWidth']) && $this->validateConfig('MaxWidth', $configuration)) {
83
            if ($width > $configuration['MaxWidth']) {
84
                throw new ValidationException('Maximum width must be '.$configuration['MaxWidth'].'px');
85
            }
86
        }
87
88
        if (isset($configuration['MinHeight']) && $this->validateConfig('MinHeight', $configuration)) {
89
            if ($height < $configuration['MinHeight']) {
@@ 88-92 (lines=5) @@
85
            }
86
        }
87
88
        if (isset($configuration['MinHeight']) && $this->validateConfig('MinHeight', $configuration)) {
89
            if ($height < $configuration['MinHeight']) {
90
                throw new ValidationException('Minimum height must be '.$configuration['MinHeight'].'px');
91
            }
92
        }
93
94
        if (isset($configuration['MaxHeight']) && $this->validateConfig('MaxHeight', $configuration)) {
95
            if ($height > $configuration['MaxHeight']) {
@@ 94-98 (lines=5) @@
91
            }
92
        }
93
94
        if (isset($configuration['MaxHeight']) && $this->validateConfig('MaxHeight', $configuration)) {
95
            if ($height > $configuration['MaxHeight']) {
96
                throw new ValidationException('Minimum height must be '.$configuration['MaxHeight'].'px');
97
            }
98
        }
99
100
        $ratio = round($width / $height, 2);
101