Skip to content

Commit 51a06ee

Browse files
Merge branch '6.3' into 6.4
* 6.3: Fix RequestPayloadValueResolver handling error with no ExpectedTypes [Mime] Fix serializing uninitialized RawMessage::$message to null [Notifer][Smsapi] Set messageId of SentMessage [DX] Use Symfony "dark-mode"-responsive logo in README support lazy evaluated exception messages with Xdebug 3 [DependencyInjection] #[Autowire] attribute should have precedence over bindings
2 parents 3f730a6 + 917d5ec commit 51a06ee

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Normalizer/MimeMessageNormalizer.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Mime\Header\UnstructuredHeader;
1818
use Symfony\Component\Mime\Message;
1919
use Symfony\Component\Mime\Part\AbstractPart;
20+
use Symfony\Component\Mime\RawMessage;
2021
use Symfony\Component\Serializer\Exception\LogicException;
2122
use Symfony\Component\Serializer\SerializerAwareInterface;
2223
use Symfony\Component\Serializer\SerializerInterface;
@@ -74,15 +75,18 @@ public function normalize(mixed $object, ?string $format = null, array $context
7475
return $ret;
7576
}
7677

78+
$ret = $this->normalizer->normalize($object, $format, $context);
79+
7780
if ($object instanceof AbstractPart) {
78-
$ret = $this->normalizer->normalize($object, $format, $context);
7981
$ret['class'] = $object::class;
8082
unset($ret['seekable'], $ret['cid'], $ret['handle']);
83+
}
8184

82-
return $ret;
85+
if ($object instanceof RawMessage && \array_key_exists('message', $ret) && null === $ret['message']) {
86+
unset($ret['message']);
8387
}
8488

85-
return $this->normalizer->normalize($object, $format, $context);
89+
return $ret;
8690
}
8791

8892
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed

0 commit comments

Comments
 (0)