Manipulation::getAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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