Completed
Pull Request — master (#41)
by
unknown
02:46
created

Contrast::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php namespace Modules\Media\Image\Intervention\Manipulations;
2
3
use Modules\Media\Image\ImageHandlerInterface;
4
5
class Contrast implements ImageHandlerInterface
6
{
7
    private $defaults = [
8
        'level' => 0,
9
    ];
10
11
    /**
12
     * Handle the image manipulation request
13
     * @param  \Intervention\Image\Image $image
14
     * @param  array                     $options
15
     * @return \Intervention\Image\Image
16
     */
17
    public function handle($image, $options)
18
    {
19
        $options = array_merge($this->defaults, $options);
20
21
        return $image->contrast($options['level']);
22
    }
23
}
24