BaseManipulator   A
last analyzed

↳ Parent: Project

Coupling/Cohesion

Components 0
Dependencies 0

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 37
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setParams() 0 6 1
A __get() 0 6 2
run() 0 1 ?
1
<?php
2
3
namespace League\Glide\Manipulators;
4
5
use Intervention\Image\Image;
6
7
abstract class BaseManipulator implements ManipulatorInterface
8
{
9
    /**
10
     * The manipulation params.
11
     * @var array
12
     */
13
    public $params = [];
14
15
    /**
16
     * Set the manipulation params.
17
     * @param array $params The manipulation params.
18
     */
19 129
    public function setParams(array $params)
20
    {
21 129
        $this->params = $params;
22
23 129
        return $this;
24
    }
25
26
    /**
27
     * Get a specific manipulation param.
28
     * @param  string $name The manipulation name.
29
     * @return string The manipulation value.
30
     */
31 138
    public function __get($name)
32
    {
33 138
        if (array_key_exists($name, $this->params)) {
34 126
            return $this->params[$name];
35
        }
36 48
    }
37
38
    /**
39
     * Perform the image manipulation.
40
     * @return Image The manipulated image.
41
     */
42
    abstract public function run(Image $image);
43
}
44