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