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