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

Colorize   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
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