ThirdpartyId::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
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