Code Duplication    Length = 5-5 lines in 2 locations

app/lib/FFCMS/Mappers/Pages.php 1 location

@@ 233-237 (lines=5) @@
230
        $max    = $f3->get('assets.image.max');
231
        $height = $img->height();
232
        $width  = $img->width();
233
        if ($width > $max['width'] || $height > $max['height']) {
234
            $height = $height > $max['height'] ? $max['height'] : $height;
235
            $width  = $width > $max['width'] ? $max['width'] : $width;
236
            $img->resize($width, $height);
237
        }
238
239
        // remove pre-existing cached-images
240
        $dirPath = $this->pageImageDirPath();

app/lib/FFCMS/Mappers/Users.php 1 location

@@ 210-214 (lines=5) @@
207
        $max    = $f3->get('assets.image.max');
208
        $height = $img->height();
209
        $width  = $img->width();
210
        if ($width > $max['width'] || $height > $max['height']) {
211
            $height = $height > $max['height'] ? $max['height'] : $height;
212
            $width  = $width > $max['width'] ? $max['width'] : $width;
213
            $img->resize($width, $height);
214
        }
215
216
        // remove pre-existing cached-images
217
        $dirPath = $this->profileImageDirPath();