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