Conditions | 7 |
Paths | 7 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 9.2312 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
51 | 7 | private function after(HttpGetResponse $res) |
|
52 | { |
||
53 | 7 | if (CURLE_OK !== $res->errno) { |
|
54 | 1 | throw new Downloader\TransportException("$res->error:$res->errno"); |
|
55 | } |
||
56 | |||
57 | 6 | switch ($res->info['http_code']) { |
|
58 | case 200: //OK |
||
59 | 3 | return; |
|
60 | case 401: //Unauthorized |
||
61 | case 403: //Forbidden |
||
62 | case 404: //Not Found |
||
63 | 4 | $res->setNeedAuth(); |
|
64 | 4 | break; |
|
65 | case 407: //Proxy Authentication Required |
||
66 | 1 | break; |
|
67 | } |
||
68 | 4 | } |
|
69 | } |
||
70 |