Passed
Pull Request — master (#8)
by Laurent
02:13
created

Type::none()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 1
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace Dolibarr\Client\Domain\Thirdparty\ValueObjects;
5
6
use Webmozart\Assert\Assert;
7
8
final class Type
9
{
10
    /**
11
     * @var int
12
     */
13
    private $value;
14
15
    private static $customer = 1;
16
17
    private static $prospect = 2;
18
19
    private static $prospectCustomer = 3;
20
21
    private static $none = 0;
22
23
    private function __construct($type)
24
    {
25
        Assert::greaterThanEq($type, 0);
26
        Assert::lessThanEq($type, 3);
27
28
        $this->value = $type;
29
    }
30
31
    public function type()
32
    {
33
        return $this->value;
34
    }
35
36
    public static function customer()
37
    {
38
        return new self(self::$customer);
39
    }
40
41
    public static function prospect()
42
    {
43
        return new self(self::$prospect);
44
    }
45
46
    public static function prospectCustomer()
47
    {
48
        return new self(self::$prospectCustomer);
49
    }
50
51
    public static function none()
52
    {
53
        return new self(self::$none);
54
    }
55
}
56