Skip to content

Commit 906e4ee

Browse files
committed
sync message serializer code for forward-compatibility
1 parent e92323d commit 906e4ee

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/Symfony/Component/Mime/Tests/MessageTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ public function testSymfonySerialize()
202202
"disposition": null,
203203
"name": null,
204204
"encoding": "quoted-printable",
205-
"seekable": null,
206205
"headers": [],
207206
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\TextPart"
208207
},
@@ -213,7 +212,6 @@ public function testSymfonySerialize()
213212
"disposition": null,
214213
"name": null,
215214
"encoding": "quoted-printable",
216-
"seekable": null,
217215
"headers": [],
218216
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\TextPart"
219217
}
@@ -224,15 +222,12 @@ public function testSymfonySerialize()
224222
{
225223
"filename": "text.txt",
226224
"mediaType": "application",
227-
"cid": null,
228-
"handle": null,
229225
"body": "text data",
230226
"charset": null,
231227
"subtype": "octet-stream",
232228
"disposition": "attachment",
233229
"name": "text.txt",
234230
"encoding": "base64",
235-
"seekable": null,
236231
"headers": [],
237232
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\DataPart"
238233
}

src/Symfony/Component/Mime/composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
"symfony/dependency-injection": "^5.4|^6.0",
2727
"symfony/property-access": "^5.4|^6.0",
2828
"symfony/property-info": "^5.4|^6.0",
29-
"symfony/serializer": "^5.4|^6.0"
29+
"symfony/serializer": "^6.1.6"
3030
},
3131
"conflict": {
3232
"egulias/email-validator": "~3.0.0",
3333
"phpdocumentor/reflection-docblock": "<3.2.2",
3434
"phpdocumentor/type-resolver": "<1.4.0",
35-
"symfony/mailer": "<5.4"
35+
"symfony/mailer": "<5.4",
36+
"symfony/serializer": "<6.1.6"
3637
},
3738
"autoload": {
3839
"psr-4": { "Symfony\\Component\\Mime\\": "" },

src/Symfony/Component/Serializer/Normalizer/MimeMessageNormalizer.php

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function normalize(mixed $object, string $format = null, array $context =
6565
if ($object instanceof AbstractPart) {
6666
$ret = $this->normalizer->normalize($object, $format, $context);
6767
$ret['class'] = \get_class($object);
68+
unset($ret['seekable'], $ret['cid'], $ret['handle']);
6869

6970
return $ret;
7071
}

0 commit comments

Comments
 (0)