File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
src/Symfony/Component/Mime Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -502,15 +502,11 @@ private function prepareParts(): ?array
502502 }
503503
504504 // usage of reflection is a temporary workaround for missing getters that will be added in 6.2
505- $ dispositionRef = new \ReflectionProperty (TextPart::class, 'disposition ' );
506- $ dispositionRef ->setAccessible (true );
507- $ nameRef = new \ReflectionProperty (TextPart::class, 'name ' );
508- $ nameRef ->setAccessible (true );
509505 $ attachmentParts = $ inlineParts = [];
510506 foreach ($ this ->attachments as $ attachment ) {
511507 $ part = $ this ->createDataPart ($ attachment );
512508 if (isset ($ attachment ['part ' ])) {
513- $ attachment ['name ' ] = $ nameRef -> getValue ( $ part );
509+ $ attachment ['name ' ] = $ part -> getName ( );
514510 }
515511
516512 foreach ($ names as $ name ) {
@@ -527,7 +523,7 @@ private function prepareParts(): ?array
527523 break ;
528524 }
529525
530- if ('inline ' === $ dispositionRef -> getValue ( $ part )) {
526+ if ('inline ' === $ part -> getDisposition ( )) {
531527 $ inlineParts [$ attachment ['name ' ]] = $ part ;
532528 } else {
533529 $ attachmentParts [] = $ part ;
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ public function setDisposition(string $disposition): static
8989 return $ this ;
9090 }
9191
92+ public function getDisposition (): string
93+ {
94+ return $ this ->disposition ;
95+ }
96+
9297 /**
9398 * Sets the name of the file (used by FormDataPart).
9499 *
@@ -102,7 +107,7 @@ public function setName(string $name): static
102107 }
103108
104109 /**
105- * Gets the name of the file (used by FormDataPart) .
110+ * Gets the name of the file.
106111 */
107112 public function getName (): ?string
108113 {
You can’t perform that action at this time.
0 commit comments