ThirdpartyId   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A __construct() 0 7 1
1
<?php
2
3
4
namespace Dolibarr\Client\Domain\Thirdparty;
5
6
use Webmozart\Assert\Assert;
7
8
/**
9
 * Value object of a thirdparty id.
10
 *
11
 * @author Laurent De Coninck <[email protected]>
12
 */
13
class ThirdpartyId
14
{
15
16
    /**
17
     * @var int
18
     */
19
    private $id;
20
21
    /**
22
     * @param int $id
23
     */
24
    public function __construct($id)
25
    {
26
        Assert::integer($id);
27
        Assert::greaterThan($id, 0);
28
        Assert::notNull($id);
29
30
        $this->id = $id;
31
    }
32
33
    /**
34
     * @return int
35
     */
36
    public function getId()
37
    {
38
        return $this->id;
39
    }
40
}
41