Manipulation   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 10
dl 0
loc 65
ccs 10
cts 15
cp 0.6667
rs 10
c 2
b 1
f 1
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getAttributes() 0 3 1
A create() 0 3 1
A __construct() 0 4 1
A getName() 0 3 1
A setAttributes() 0 3 1
A setName() 0 3 1
1
<?php
2
3
namespace ByTIC\MediaLibrary\Conversions\Manipulations;
4
5
/**
6
 * Class Manipulation.
7
 */
8
class Manipulation
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $name;
14
15
    /**
16
     * @var array
17
     */
18
    protected $attributes = [];
19
20
    /**
21
     * Manipulation constructor.
22
     *
23
     * @param string $name
24
     * @param array  $attributes
25
     */
26 7
    public function __construct($name, ...$attributes)
27
    {
28 7
        $this->name = $name;
29 7
        $this->attributes = $attributes;
30 7
    }
31
32
    /**
33
     * @param $name
34
     * @param array ...$atributes
35
     *
36
     * @return Manipulation
37
     */
38 6
    public static function create($name, ...$atributes)
39
    {
40 6
        return new self($name, ...$atributes);
41
    }
42
43
    /**
44
     * @return string
45
     */
46 3
    public function getName(): string
47
    {
48 3
        return $this->name;
49
    }
50
51
    /**
52
     * @param string $name
53
     */
54
    public function setName(string $name)
55
    {
56
        $this->name = $name;
57
    }
58
59
    /**
60
     * @return array
61
     */
62 3
    public function getAttributes(): array
63
    {
64 3
        return $this->attributes;
65
    }
66
67
    /**
68
     * @param array $attributes
69
     */
70
    public function setAttributes(array $attributes)
71
    {
72
        $this->attributes = $attributes;
73
    }
74
}
75