Code Duplication    Length = 6-6 lines in 2 locations

src/Image.php 2 locations

@@ 177-182 (lines=6) @@
174
            }
175
        }
176
177
        if ($upsize && ($width < $targetWidth || $height < $targetHeight)) {
178
            if ($clone->resizeImage($targetWidth, $targetHeight, \Imagick::FILTER_CUBIC, 1.0, $bestfit) !== true) {
179
                //cumbersome to test
180
                throw new \Exception('Imagick::resizeImage() did not return true');//@codeCoverageIgnore
181
            }
182
        }
183
184
        if ($clone->getImageHeight() === $boxHeight && $clone->getImageWidth() === $boxWidth) {
185
            return $clone;
@@ 380-385 (lines=6) @@
377
                }
378
            }
379
380
            if ($upsize && ($width < $targetWidth || $height < $targetHeight)) {
381
                if ($clone->resizeImage($targetWidth, $targetHeight, \Imagick::FILTER_CUBIC, 1.0, $bestfit) !== true) {
382
                    //cumbersome to test
383
                    throw new \Exception('Imagick::resizeImage() did not return true');//@codeCoverageIgnore
384
                }
385
            }
386
387
            if ($clone->getImageHeight() === $boxHeight && $clone->getImageWidth() === $boxWidth) {
388
                $results[$boxSizeKey] = $clone;