| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 31 | 12 | public function run($pointName, array $data = [], array $headers = []) |
|
| 32 | { |
||
| 33 | 12 | $this->endpoint = $this->api->getEndpoints()->findOrFail($pointName); |
|
| 34 | |||
| 35 | 12 | $client = new Client($this->api->getHandler()); |
|
| 36 | 12 | $response = $client->request($this->endpoint->getMethod(), $this->endpoint->getUri(), $this->makeBody($headers, $data)); |
|
| 37 | |||
| 38 | 12 | return new Response($response, $this->endpoint->getTransformer()); |
|
|
|
|||
| 39 | } |
||
| 40 | |||
| 64 |
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.