@@ -31,6 +31,7 @@ public static function normalize(
3131
3232 return self ::normalizeEmail ($ message , $ envelope , $ raw , $ storeAttachmentsInline );
3333 }
34+
3435 // RawMessage (non-Email) fallback
3536 return self ::normalizeRaw ($ message , $ envelope , $ raw );
3637 }
@@ -43,7 +44,7 @@ private static function normalizeRaw(
4344 ): array {
4445 return [
4546 'version ' => 1 ,
46- 'saved_at ' => (new \DateTimeImmutable () )->format (\DateTimeInterface::ATOM ),
47+ 'saved_at ' => (new \DateTimeImmutable )->format (\DateTimeInterface::ATOM ),
4748 'subject ' => null ,
4849 'from ' => [],
4950 'to ' => [],
@@ -58,7 +59,6 @@ private static function normalizeRaw(
5859 ];
5960 }
6061
61-
6262 /** @return array<string,mixed> */
6363 private static function normalizeEmail (
6464 Email $ email ,
@@ -74,7 +74,6 @@ private static function normalizeEmail(
7474 $ attachments = [];
7575 foreach ($ email ->getAttachments () as $ part ) {
7676 /** @var DataPart $part */
77-
7877 $ filename = $ part ->getFilename ();
7978 $ contentId = $ part ->getPreparedHeaders ()->has ('Content-ID ' )
8079 ? trim ($ part ->getPreparedHeaders ()->get ('Content-ID ' )->getBodyAsString (), '<> ' )
@@ -84,7 +83,6 @@ private static function normalizeEmail(
8483 ? $ part ->getPreparedHeaders ()->get ('Content-Disposition ' )->getBodyAsString ()
8584 : null ;
8685
87-
8886 $ contentType = $ part ->getPreparedHeaders ()->has ('Content-Type ' )
8987 ? $ part ->getPreparedHeaders ()->get ('Content-Type ' )->getBodyAsString ()
9088 : null ;
@@ -112,7 +110,7 @@ private static function normalizeEmail(
112110 'inline ' => $ contentId !== null ,
113111 'size ' => $ size ,
114112 'content ' => $ bodyBase64 , // base64 or null
115- ], static fn ($ v ) => $ v !== null );
113+ ], static fn ($ v ) => $ v !== null );
116114 }
117115
118116 // Prefer explicitly set envelope sender/recipients, fallback to headers
@@ -152,7 +150,6 @@ private static function normalizeEmail(
152150
153151 /**
154152 * @param Address[] $addresses
155- *
156153 * @return array<int,array{name?:string,email:string}>
157154 */
158155 private static function addressesToArray (iterable $ addresses ): array
@@ -177,11 +174,10 @@ private static function addressToArray(Address $address): array
177174 ]);
178175 }
179176
180-
181177 private static function firstHeader (Email $ email , string $ name ): ?string
182178 {
183179 $ headers = $ email ->getHeaders ();
184- if (!$ headers ->has ($ name )) {
180+ if (! $ headers ->has ($ name )) {
185181 return null ;
186182 }
187183
0 commit comments