| Conditions | 3 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 3 | public function detect(ResponseInterface $response) |
|
| 44 | { |
||
| 45 | 3 | if ($response->getStatusCode() == 404) { |
|
| 46 | 1 | throw NotFoundException::page(); |
|
| 47 | } |
||
| 48 | |||
| 49 | 2 | $content = $response->getBody()->getContents(); |
|
| 50 | |||
| 51 | 2 | if (strpos($content, 'Access has been restricted for this account.') !== false) { |
|
| 52 | 1 | throw BannedException::banned(); |
|
| 53 | } |
||
| 54 | |||
| 55 | 1 | return $content; |
|
| 56 | } |
||
| 58 |