File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -501,16 +501,11 @@ private function prepareParts(): ?array
501
501
$ names = array_filter (array_unique ($ names ));
502
502
}
503
503
504
- // 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 );
509
504
$ attachmentParts = $ inlineParts = [];
510
505
foreach ($ this ->attachments as $ attachment ) {
511
506
$ part = $ this ->createDataPart ($ attachment );
512
507
if (isset ($ attachment ['part ' ])) {
513
- $ attachment ['name ' ] = $ nameRef -> getValue ( $ part );
508
+ $ attachment ['name ' ] = $ part -> getName ( );
514
509
}
515
510
516
511
foreach ($ names as $ name ) {
@@ -527,7 +522,7 @@ private function prepareParts(): ?array
527
522
break ;
528
523
}
529
524
530
- if ('inline ' === $ dispositionRef -> getValue ( $ part )) {
525
+ if ('inline ' === $ part -> getDisposition ( )) {
531
526
$ inlineParts [$ attachment ['name ' ]] = $ part ;
532
527
} else {
533
528
$ attachmentParts [] = $ part ;
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ public function setDisposition(string $disposition): static
89
89
return $ this ;
90
90
}
91
91
92
+ public function getDisposition (): ?string
93
+ {
94
+ return $ this ->disposition ;
95
+ }
96
+
92
97
/**
93
98
* Sets the name of the file (used by FormDataPart).
94
99
*
@@ -102,7 +107,7 @@ public function setName(string $name): static
102
107
}
103
108
104
109
/**
105
- * Gets the name of the file (used by FormDataPart) .
110
+ * Gets the name of the file.
106
111
*/
107
112
public function getName (): ?string
108
113
{
You can’t perform that action at this time.
0 commit comments