Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  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
  Provide more precise phpdoc for FileLocatorInterface::locate
  [DependencyInjection] #[Autowire] attribute should have precedence over bindings
  • Loading branch information
nicolas-grekas committed Jan 30, 2024
2 parents f1c9d0f + 51a06ee commit 6e83031
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Normalizer/MimeMessageNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Mime\Header\UnstructuredHeader;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\Part\AbstractPart;
use Symfony\Component\Mime\RawMessage;
use Symfony\Component\Serializer\Exception\LogicException;
use Symfony\Component\Serializer\SerializerAwareInterface;
use Symfony\Component\Serializer\SerializerInterface;
Expand Down Expand Up @@ -72,15 +73,18 @@ public function normalize(mixed $object, ?string $format = null, array $context
return $ret;
}

$ret = $this->normalizer->normalize($object, $format, $context);

if ($object instanceof AbstractPart) {
$ret = $this->normalizer->normalize($object, $format, $context);
$ret['class'] = $object::class;
unset($ret['seekable'], $ret['cid'], $ret['handle']);
}

return $ret;
if ($object instanceof RawMessage && \array_key_exists('message', $ret) && null === $ret['message']) {
unset($ret['message']);
}

return $this->normalizer->normalize($object, $format, $context);
return $ret;
}

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

0 comments on commit 6e83031

Please sign in to comment.