Skip to content

Commit

Permalink
Merge branch '6.3' into 6.4
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Jan 30, 2024
2 parents 3f730a6 + 917d5ec commit 51a06ee
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 @@ -74,15 +75,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 51a06ee

Please sign in to comment.