Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2.032 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 13 | public function create(Response $response, $affectedUrl = '') { |
|
25 | 13 | $html = $response->getBody(); |
|
26 | 13 | $html = Helper::safeEncodeStr((string) $html); |
|
27 | 13 | $contentType = $response->getHeaderLine('content-type'); |
|
28 | 13 | $html = HtmlEncodingConverter::convertToUtf($html, $contentType); |
|
|
|||
29 | 13 | $page = new ElementFinder((string) $html); |
|
30 | |||
31 | 13 | if ($affectedUrl) { |
|
32 | LinkConverter::convertUrlsToAbsolute($page, $affectedUrl); |
||
33 | } |
||
34 | |||
35 | 13 | return $page; |
|
36 | } |
||
37 | |||
38 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: