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

Extension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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