| Conditions | 7 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 24.8582 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 61 | 2 | public function after(HttpGetResponse $res) |
|
| 62 | { |
||
| 63 | 2 | if (CURLE_OK !== $res->errno) { |
|
| 64 | throw new Downloader\TransportException("$res->error:$res->errno"); |
||
| 65 | } |
||
| 66 | |||
| 67 | 2 | 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 | $res->setNeedAuth(); |
||
| 74 | break; |
||
| 75 | case 407: //Proxy Authentication Required |
||
| 76 | break; |
||
| 77 | } |
||
| 78 | } |
||
| 79 | } |
||
| 80 |