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