-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separating Swiftmailer to Symfony Mailer from Symfony 5.3 set (#548)
- Loading branch information
1 parent
38014d4
commit b7df4d8
Showing
3 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\Renaming\Rector\Name\RenameClassRector; | ||
use Rector\Symfony\Symfony53\Rector\MethodCall\SwiftCreateMessageToNewEmailRector; | ||
use Rector\Symfony\Symfony53\Rector\MethodCall\SwiftSetBodyToHtmlPlainMethodCallRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
// @see https://symfony.com/blog/the-end-of-swiftmailer | ||
$rectorConfig->rules([ | ||
SwiftCreateMessageToNewEmailRector::class, | ||
SwiftSetBodyToHtmlPlainMethodCallRector::class, | ||
]); | ||
|
||
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ | ||
'Swift_Mailer' => 'Symfony\Component\Mailer\MailerInterface', | ||
'Swift_Message' => 'Symfony\Component\Mime\Email', | ||
// message | ||
'Swift_Mime_SimpleMessage' => 'Symfony\Component\Mime\RawMessage', | ||
// transport | ||
'Swift_SmtpTransport' => 'Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport', | ||
'Swift_FailoverTransport' => 'Symfony\Component\Mailer\Transport\FailoverTransport', | ||
'Swift_SendmailTransport' => 'Symfony\Component\Mailer\Transport\SendmailTransport', | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Symfony\Set; | ||
|
||
use Rector\Set\Contract\SetListInterface; | ||
|
||
/** | ||
* @api | ||
*/ | ||
final class SwiftmailerSetList implements SetListInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
final public const ANNOTATIONS_TO_ATTRIBUTES = __DIR__ . '/../../config/sets/swiftmailer/swiftmailer-to-symfony-mailer.php'; | ||
} |