ResourceId::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Dolibarr\Client\Domain\Resource;
5
6
use Webmozart\Assert\Assert;
7
8
/**
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class ResourceId
12
{
13
14
    /**
15
     * @var int
16
     */
17
    private $id;
18
19
    /**
20
     * ResourceId constructor.
21
     *
22
     * @param int $id
23
     */
24
    public function __construct($id)
25
    {
26
        Assert::integerish($id);
27
        Assert::greaterThan($id, 0);
28
29
        $this->id = (int) $id;
30
    }
31
32
    /**
33
     * @return int
34
     */
35
    public function getId()
36
    {
37
        return $this->id;
38
    }
39
}
40