| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 9 | public function __construct(string $url, int $depth = 0) |
|
| 28 | { |
||
| 29 | 9 | if (!filter_var($url, FILTER_VALIDATE_URL)) { |
|
| 30 | 1 | throw new InvalidUrlException("Provided URL is invalid: {$url}"); |
|
| 31 | } |
||
| 32 | |||
| 33 | 8 | if ($depth < 0) { |
|
| 34 | 1 | throw new \InvalidArgumentException('Provided depth must be non negative'); |
|
| 35 | } |
||
| 36 | 7 | $this->url = $url; |
|
| 37 | 7 | $this->depth = $depth; |
|
| 38 | 7 | } |
|
| 56 |