Conditions | 5 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
23 | 36 | public function __construct(string $type, string $id = null, string $url = null) |
|
24 | { |
||
25 | 36 | $this->type = $type; |
|
26 | 36 | $this->id = $id; |
|
27 | 36 | $this->url = $url; |
|
28 | |||
29 | 36 | if ($type == self::TYPE_CUSTOM && !isset($url)) { |
|
30 | 4 | throw new \UnexpectedValueException('Please set url for custom counter'); |
|
31 | } |
||
32 | |||
33 | 32 | if ($type != self::TYPE_CUSTOM && !isset($id)) { |
|
34 | 4 | throw new \UnexpectedValueException('Please set id for non custom counter'); |
|
35 | } |
||
36 | 28 | } |
|
37 | |||
55 | } |