Skip to content

Commit 5369200

Browse files
committed
minor #51142 [Mailer] Precise AbstractApiTransport::getRecipients signature (VincentLanglet)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Mailer] Precise AbstractApiTransport::getRecipients signature | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Not sure about the branch I should target for this PHPdoc. I started with 6.4 cause I assume the PR is not finished... `AbstractApiTransport::getRecipients` is filtering the `Address[]` so return an array of Address too, adding the ``@return`` phpdoc will help with autocompletion from PHPStorm and for static analysis. Currently I have a some issue with adding the phpdoc, `MandrillApiTransport` is overriding the getRecipients without keeping the same structure ; I don't think it's a good practice since we can't be sure about the array elements then... Maybe `MandrillApiTransport` should have his own `getPayloadRecipients` instead of overriding `getRecipients` ? Commits ------- 3f1f89f9a4 [Mailer] Precise AbstractApiTransport::getRecipients signature
2 parents dcd9f9b + 45df1ed commit 5369200

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Transport/AbstractApiTransport.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ protected function doSendHttp(SentMessage $message): ResponseInterface
3737
return $this->doSendApi($message, $email, $message->getEnvelope());
3838
}
3939

40+
/**
41+
* @return Address[]
42+
*/
4043
protected function getRecipients(Email $email, Envelope $envelope): array
4144
{
4245
return array_filter($envelope->getRecipients(), fn (Address $address) => false === \in_array($address, array_merge($email->getCc(), $email->getBcc()), true));

0 commit comments

Comments
 (0)