Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 3.1852 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | 1 | private function get_http_response_code(string $url) { |
|
17 | 1 | if($url =='') return false; |
|
18 | |||
19 | // Avoid ssl errors: SSL operation failed with code 1 |
||
20 | stream_context_set_default([ |
||
21 | 'ssl' => [ |
||
22 | 'verify_peer' => false, |
||
23 | 'verify_peer_name' => false, |
||
24 | ], |
||
25 | ]); |
||
26 | |||
27 | $headers = get_headers($url); |
||
28 | return substr($headers[0], 9, 3); |
||
29 | } |
||
36 |