$message = $this->serializer->deserialize(
$buffer,
SubmissionProducerMessage::class,
'json',
);
Should be of type SubmissionProducerMessage, but instead it's of type mixed.
This is the definition of the deserialize method:
/**
* Deserializes data into the given type.
*
* @template TObject of object
* @template TType of string|class-string<TObject>
*
* @param TType $type
* @param array<string, mixed> $context
*
* @phpstan-return ($type is class-string<TObject> ? TObject : mixed)
*
* @psalm-return (TType is class-string<TObject> ? TObject : mixed)
*
* @throws NotNormalizableValueException Occurs when a value cannot be denormalized
* @throws UnexpectedValueException Occurs when a value cannot be decoded
* @throws ExceptionInterface Occurs for all the other cases of serialization-related errors
*/
public function deserialize(mixed $data, string $type, string $format, array $context = []): mixed;
Should be of type SubmissionProducerMessage, but instead it's of type mixed.
This is the definition of the deserialize method: