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 |
||
24 | 3 | public function detect(ResponseInterface $response) |
|
25 | { |
||
26 | 3 | if ($response->getStatusCode() == 404) { |
|
27 | 1 | throw NotFoundException::page(); |
|
28 | } |
||
29 | |||
30 | 2 | $content = $response->getBody()->getContents(); |
|
31 | |||
32 | 2 | if (strpos($content, 'Access has been restricted for this account.') !== false) { |
|
33 | 1 | throw BannedException::banned(); |
|
34 | } |
||
35 | |||
36 | 1 | return $content; |
|
37 | } |
||
39 |