File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,7 @@ public function shutdown() : void
5454 $ body = new MimeMessage ();
5555 $ body ->addPart ($ mimePart );
5656
57- foreach ($ this ->requestData ['files_data ' ] as $ key => $ row ) {
58- if (\key ($ row ) === 'name ' ) {
59- // single upload
60- $ body = $ this ->singleBodyAddPart ($ body , $ row );
61- continue ;
62- }
63-
64- // collection upload
65- $ body = $ this ->collectionBodyAddPart ($ body , $ row );
66- }
67-
57+ $ body = $ this ->bodyAddPart ($ body , $ this ->requestData ['files_data ' ]);
6858 $ this ->mail ->setBody ($ body );
6959
7060 $ headers = $ this ->mail ->getHeaders ();
@@ -100,15 +90,15 @@ private function singleBodyAddPart(MimeMessage $body, array $data) : MimeMessage
10090 return $ body ->addPart ($ mimePart );
10191 }
10292
103- private function collectionBodyAddPart (MimeMessage $ body , array $ data ) : MimeMessage
93+ private function bodyAddPart (MimeMessage $ body , array $ data ) : MimeMessage
10494 {
10595 foreach ($ data as $ multiple => $ upload ) {
10696 if (\key ($ upload ) === 'name ' ) {
10797 $ body = $ this ->singleBodyAddPart ($ body , $ upload );
10898 continue ;
10999 }
110100
111- $ body = $ this ->collectionBodyAddPart ($ body , $ upload );
101+ $ body = $ this ->bodyAddPart ($ body , $ upload );
112102 }
113103
114104 return $ body ;
You can’t perform that action at this time.
0 commit comments