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

Trim   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 22
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 Trim implements ImageHandlerInterface
6
{
7
    private $defaults = [
8
        'base' => 'top-left',
9
        'away' => ['top', 'bottom', 'left', 'right'],
10
        'tolerance' => 0,
11
        'feather' => 0,
12
    ];
13
14
    /**
15
     * Handle the image manipulation request
16
     * @param  \Intervention\Image\Image $image
17
     * @param  array                     $options
18
     * @return \Intervention\Image\Image
19
     */
20
    public function handle($image, $options)
21
    {
22
        $options = array_merge($this->defaults, $options);
23
24
        return $image->trim($options['base'], $options['away'], $options['tolerance'], $options['feather']);
0 ignored issues
show
Bug introduced by
The call to trim() misses a required argument $'right'.

This check looks for function calls that miss required arguments.

Loading history...
25
    }
26
}
27