Closed tristanbes closed 5 years ago
You are correct. When using the Serializer (with Messanger) you get an envelope. Doing:
if ($message instanceof Envelope) {
$message = $message->getMessage();
}
is what I do too.
Maybe we should update the docs with that and a small comment.
Hello,
I'm not sure but following the documentation gives me an error
Transformer "App\Admin\KeywordBundle\Message\KeywordMessage" failed to transform a message.
Dumping the
$message
variable in theTransformer.php
(on your lib) shows that it's an instance of Envelope;So it's logic that fails
So either I'm missing something, either the documentation is wrong and should add:
(I don't know if the getPayload recieves 100% of the time an Envelope object; so depending on this question, the code could be improved;