| 1 | <?php namespace Atog\Api; |
||
| 9 | abstract class Endpoint |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var \Atog\Api\Client |
||
| 13 | */ |
||
| 14 | protected $client; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var \Atog\Api\Model |
||
| 18 | */ |
||
| 19 | protected $model; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $endpoint; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Endpoint constructor. |
||
| 28 | * @param \Atog\Api\Client $client |
||
| 29 | * @param \Atog\Api\Model $model |
||
| 30 | */ |
||
| 31 | 8 | public function __construct(Client $client, Model $model) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @return \Atog\Api\Model |
||
| 39 | */ |
||
| 40 | 3 | public function getModel() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Get the endpoint url for the request |
||
| 47 | * @param string $path |
||
| 48 | * @param bool $withTrailingSlash |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 1 | public function getEndpointUrl($path, $withTrailingSlash) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
| 64 | * @return \Atog\Api\Model|null |
||
| 65 | */ |
||
| 66 | 2 | public function respond(Response $response) |
|
| 75 | } |
||
| 76 |
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: