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

Colorize::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 Colorize implements ImageHandlerInterface
6
{
7
    private $defaults = [
8
        'red' => 100,
9
        'green' => 100,
10
        'blue' => 100,
11
    ];
12
13
    /**
14
     * Handle the image manipulation request
15
     * @param  \Intervention\Image\Image $image
16
     * @param  array                     $options
17
     * @return \Intervention\Image\Image
18
     */
19
    public function handle($image, $options)
20
    {
21
        $options = array_merge($this->defaults, $options);
22
23
        return $image->colorize($options['red'], $options['green'], $options['blue']);
24
    }
25
}
26