Passed
Push — master ( b1cf97...31fd3d )
by Agaletskiy
42s queued 11s
created

Extension   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 61
rs 10
c 0
b 0
f 0
ccs 21
cts 21
cp 1

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A light() 0 4 1
A pharma() 0 4 1
A tobacco() 0 4 1
A milk() 0 4 1
A tires() 0 4 1
A photo() 0 4 1
A perfum() 0 4 1
A getName() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\OmsClient\V2;
6
7
final class Extension
8
{
9
    /**
10
     * @var string
11
     */
12
    private $name;
13
14
    /**
15
     * OmsApiExtension constructor.
16
     * @param string $name
17
     */
18 8
    private function __construct(string $name)
19
    {
20 8
        $this->name = $name;
21 8
    }
22
23 1
    public static function light(): self
24
    {
25 1
        return new static('light');
26
    }
27
28 1
    public static function pharma(): self
29
    {
30 1
        return new static('pharma');
31
    }
32
33 1
    public static function tobacco(): self
34
    {
35 1
        return new static('tobacco');
36
    }
37
38 2
    public static function milk(): self
39
    {
40 2
        return new static('milk');
41
    }
42
43 1
    public static function tires(): self
44
    {
45 1
        return new static('tires');
46
    }
47
48 1
    public static function photo(): self
49
    {
50 1
        return new static('photo');
51
    }
52
53 1
    public static function perfum(): self
54
    {
55 1
        return new static('perfum');
56
    }
57
58 7
    public function getName(): string
59
    {
60 7
        return $this->name;
61
    }
62
63 1
    public function __toString(): string
64
    {
65 1
        return $this->name;
66
    }
67
}