Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 2 | ||
34 | try { |
||
35 | 2 | $response = $this->client->post($url, ['headers' => ['Content-Type' => 'application/xml; charset=UTF-8'], 'body' => $body->asXML(), 'verify' => false]); |
|
36 | 1 | } catch (RequestException $e) { |
|
37 | throw PagSeguroException::create($e->getResponse()); |
||
|
|||
38 | } |
||
39 | 1 | ||
40 | return new SimpleXMLElement((string) $response->getBody()); |
||
41 | } |
||
58 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.