| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.032 |
| Changes | 6 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 13 | public function create(Response $response, $affectedUrl = '') { |
|
| 23 | 13 | $html = $response->getBody(); |
|
| 24 | 13 | $html = Helper::safeEncodeStr((string) $html); |
|
| 25 | 13 | $contentType = $response->getHeaderLine('content-type'); |
|
| 26 | 13 | $html = HtmlEncodingConverter::convertToUtf($html, $contentType); |
|
|
|
|||
| 27 | 13 | $page = new ElementFinder((string) $html); |
|
| 28 | |||
| 29 | 13 | if ($affectedUrl) { |
|
| 30 | LinkConverter::convertUrlsToAbsolute($page, $affectedUrl); |
||
| 31 | } |
||
| 32 | |||
| 33 | 13 | return $page; |
|
| 34 | } |
||
| 35 | |||
| 36 | } |
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: