1 | <?php |
||
22 | class FormatArgument extends BaseArgument |
||
23 | { |
||
24 | public const ARGUMENT_NAME = 'format'; |
||
25 | public const ARGUMENT_DESCRIPTION = ' |
||
26 | An argument that provides a format of the given value that |
||
27 | are contained in a CarbonFormat enumeration type |
||
28 | '; |
||
29 | |||
30 | /** |
||
31 | * @var CompilerInterface|Configuration |
||
32 | */ |
||
33 | private $compiler; |
||
34 | |||
35 | /** |
||
36 | * DiffArgument constructor. |
||
37 | * @param FieldDefinition $field |
||
38 | * @param CompilerInterface $compiler |
||
39 | */ |
||
40 | public function __construct(FieldDefinition $field, CompilerInterface $compiler) |
||
51 | |||
52 | /** |
||
53 | * @return TypeDefinition |
||
54 | */ |
||
55 | public function getTypeDefinition(): TypeDefinition |
||
59 | } |
||
60 |
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: