-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt to Swiftmailer 5 and Swiftmailer 6 version of class Swift_Confi…
…gurableSpool
- Loading branch information
Showing
3 changed files
with
31 additions
and
4 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
21 changes: 21 additions & 0 deletions
21
lib/plugins/sfDoctrinePlugin/lib/mailer/Swift_DoctrineSpoolAdapter.php
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,21 @@ | ||
<?php | ||
|
||
// Defining a base class for Swift_DoctrineSpool to handle both, Swiftmailer 5 and Swiftmailer 6, | ||
// as we are implementing a base class from the package, we can't simply remove the type hint. | ||
if(class_exists('Swift') && version_compare(Swift::VERSION, '6.0.0') >= 0) { | ||
abstract class Swift_DoctrineSpoolAdapter extends Swift_DoctrineSpoolBase | ||
{ | ||
public function queueMessage(Swift_Mime_SimpleMessage $message) | ||
{ | ||
$this->internalQueueMessage($message); | ||
} | ||
} | ||
} else { | ||
abstract class Swift_DoctrineSpoolAdapter extends Swift_DoctrineSpoolBase | ||
{ | ||
public function queueMessage(Swift_Mime_Message $message) | ||
{ | ||
$this->internalQueueMessage($message); | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
lib/plugins/sfDoctrinePlugin/lib/mailer/Swift_DoctrineSpoolBase.php
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,6 @@ | ||
<?php | ||
|
||
abstract class Swift_DoctrineSpoolBase extends Swift_ConfigurableSpool | ||
{ | ||
protected abstract function internalQueueMessage($message); | ||
} |