| 1 | <?php |
||
| 10 | trait QueryBusTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var QueryBus |
||
| 14 | */ |
||
| 15 | private $queryBus; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @return \Mockery\MockInterface|QueryBus |
||
| 19 | */ |
||
| 20 | protected function getQueryBus() |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param QueryInterface $query |
||
| 27 | * @param mixed $return |
||
| 28 | */ |
||
| 29 | protected function shouldHandleQuery(QueryInterface $query, $return) |
||
| 37 | } |
||
| 38 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: