Attributor   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAttributes() 0 3 1
A getCase() 0 3 1
A to() 0 3 1
A __construct() 0 4 1
1
<?php
2
/**
3
 * Created by enea dhack - 12/07/2020 11:19.
4
 */
5
6
namespace Vaened\Enum;
7
8
class Attributor
9
{
10
    private string $case;
11
12
    private array $attributes;
13
14
    public function __construct(string $case, array $attributes)
15
    {
16
        $this->case = $case;
17
        $this->attributes = $attributes;
18
    }
19
20
    public static function to(string $case, array $attributes): static
21
    {
22
        return new static($case, $attributes);
23
    }
24
25
    public function getCase(): string
26
    {
27
        return $this->case;
28
    }
29
30
    public function getAttributes(): array
31
    {
32
        return $this->attributes;
33
    }
34
}
35