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