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