| 1 | <?php |
||
| 21 | class ArgumentValueNode extends AbstractValueNode |
||
| 22 | { |
||
| 23 | use DependentNameProvider; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return \Generator|mixed |
||
| 27 | */ |
||
| 28 | protected function parse() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return null|RuleInterface|AstValueInterface |
||
| 35 | */ |
||
| 36 | public function getValue() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param Readable $file |
||
| 50 | * @return ValueInterface |
||
| 51 | */ |
||
| 52 | public function toValue(Readable $file): ValueInterface |
||
| 56 | } |
||
| 57 |
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: