Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait Id |
||
10 | { |
||
11 | /** |
||
12 | * @var int |
||
13 | */ |
||
14 | private $id; |
||
15 | |||
16 | /** |
||
17 | * @param int $id |
||
18 | */ |
||
19 | public function __construct($id) |
||
20 | { |
||
21 | Assert::integer($id); |
||
22 | Assert::greaterThan($id, 0); |
||
23 | Assert::notNull($id); |
||
24 | |||
25 | $this->id = $id; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param ResourceId $resourceId |
||
30 | * |
||
31 | * @return self |
||
32 | */ |
||
33 | public static function fromResourceId(ResourceId $resourceId) |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return int |
||
40 | */ |
||
41 | public function getId() |
||
44 | } |
||
45 | } |
||
46 |