Skip to content

Commit cb1ab07

Browse files
committed
bug symfony#30677 Fix type hints for email attachments (fabpot)
This PR was merged into the 4.3-dev branch. Discussion ---------- Fix type hints for email attachments | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a `createDataPart()` must return a `DataPart` instance, so `attachPart()` must only accept `DataPart` instances and `getAttachments()` is guaranteed to return an array of `DataPart` instances. Commits ------- 8059c50 fixed type hints for email attachments
2 parents 041f60f + 8059c50 commit cb1ab07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Mime/Email.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,15 @@ public function embedFromPath(string $path, string $name = null, string $content
372372
/**
373373
* @return $this
374374
*/
375-
public function attachPart(AbstractPart $part)
375+
public function attachPart(DataPart $part)
376376
{
377377
$this->attachments[] = ['part' => $part];
378378

379379
return $this;
380380
}
381381

382382
/**
383-
* @return AbstractPart[]
383+
* @return DataPart[]
384384
*/
385385
public function getAttachments(): array
386386
{

0 commit comments

Comments
 (0)