Medium::applyFilter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Larafolio\Http\ImageFilters;
4
5
use Intervention\Image\Image;
6
use Intervention\Image\Constraint;
7
use Intervention\Image\Filters\FilterInterface;
8
9
class Medium implements FilterInterface
10
{
11
    /**
12
     * Apply medium filter to image.
13
     *
14
     * @param \Intervention\Image\Image $image
15
     *
16
     * @return \Intervention\Image\Image
17
     */
18
    public function applyFilter(Image $image)
19
    {
20
        return $image->resize(null, 300, function (Constraint $constraint) {
21
            $constraint->aspectRatio();
22
        });
23
    }
24
}
25