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