| 1 | <?php |
||
| 13 | class Client { |
||
| 14 | /** |
||
| 15 | * @var HttpClient |
||
| 16 | */ |
||
| 17 | private $client; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param HttpClient $client |
||
| 21 | */ |
||
| 22 | 6 | public function __construct(HttpClient $client = null) { |
|
| 25 | 6 | ||
| 26 | 6 | /** |
|
| 27 | * @param string $url |
||
| 28 | * @param SimpleXMLElement $body |
||
| 29 | * |
||
| 30 | * @return SimpleXMLElement |
||
| 31 | */ |
||
| 32 | public function post($url, SimpleXMLElement $body) { |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $url |
||
| 45 | * |
||
| 46 | * @return SimpleXMLElement |
||
| 47 | */ |
||
| 48 | 1 | public function get($url) { |
|
| 57 | } |
||
| 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.