| 1 | <?php |
||
| 8 | trait IoInterfaceTrait |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var IOInterface |
||
| 12 | */ |
||
| 13 | private $ioInterface; |
||
| 14 | /** |
||
| 15 | * @return \Mockery\MockInterface|IOInterface |
||
| 16 | */ |
||
| 17 | protected function getIOInterface() |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param string $question |
||
| 24 | * @param string $default |
||
| 25 | * @param string $return |
||
| 26 | */ |
||
| 27 | protected function shouldAsk($question, $default, $return) |
||
| 36 | } |
||
| 37 |
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: