1 | <?php |
||
16 | final class FacadeDocBodyResponseBodyDenormalizer implements ContextAwareDenormalizerInterface, DenormalizerAwareInterface, CacheableSupportsMethodInterface |
||
17 | { |
||
18 | private const ORIGINAL_STRING_FIELD_KEY = 'original_string'; |
||
19 | |||
20 | /** |
||
21 | * @var SerializerInterface|DenormalizerInterface |
||
22 | */ |
||
23 | private $denormalizer; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function denormalize($data, $class, $format = null, array $context = []) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function supportsDenormalization($data, $type, $format = null, array $context = []): bool |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function setDenormalizer(DenormalizerInterface $denormalizer): void |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function hasCacheableSupportsMethod(): bool |
||
70 | } |
||
71 |
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: