| Total Complexity | 6 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 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 |
|
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @param array $attributes |
||
| 69 | */ |
||
| 70 | public function setAttributes(array $attributes) |
||
| 73 | } |
||
| 74 | } |
||
| 75 |