Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | public function isValid($url): bool |
||
8 | { |
||
9 | $handle = curl_init($url); |
||
10 | curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'HEAD'); |
||
|
|||
11 | curl_setopt($handle, CURLOPT_TIMEOUT, 5); |
||
12 | curl_exec($handle); |
||
13 | $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); |
||
14 | curl_close($handle); |
||
15 | |||
16 | return $httpCode < 400; |
||
17 | } |
||
19 |