1 | <?php |
||
21 | class DiffArgument extends BaseArgument |
||
22 | { |
||
23 | public const ARGUMENT_NAME = 'diff'; |
||
24 | public const ARGUMENT_DESCRIPTION = ' |
||
25 | An argument that matches the date of the time difference. |
||
26 | |||
27 | If a `NULL` is passed (or the value is not passed), |
||
28 | then the current time is taken. |
||
29 | '; |
||
30 | |||
31 | /** |
||
32 | * @var CompilerInterface|Configuration |
||
33 | */ |
||
34 | private $compiler; |
||
35 | |||
36 | /** |
||
37 | * DiffArgument constructor. |
||
38 | * @param FieldDefinition $field |
||
39 | * @param CompilerInterface $compiler |
||
40 | */ |
||
41 | public function __construct(FieldDefinition $field, CompilerInterface $compiler) |
||
52 | |||
53 | /** |
||
54 | * @return TypeDefinition |
||
55 | */ |
||
56 | public function getTypeDefinition(): TypeDefinition |
||
60 | } |
||
61 |
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: