Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function __construct($type, $id) |
||
42 | { |
||
43 | if (!is_string($type)) { |
||
44 | throw new \InvalidArgumentException('Identity node type must be string'); |
||
45 | } elseif ($type === '') { |
||
46 | throw new \InvalidArgumentException('Identity node type must be not empty'); |
||
47 | } |
||
48 | |||
49 | if (!is_int($id)) { |
||
50 | throw new \InvalidArgumentException('Identity node ID must be integer'); |
||
51 | } elseif ($id < 1) { |
||
52 | throw new \InvalidArgumentException('Identity node ID must be positive non-zero integer'); |
||
53 | } |
||
54 | |||
55 | $this->type = $type; |
||
56 | $this->id = $id; |
||
57 | } |
||
58 | |||
93 |