Skip to content

Commit f25687b

Browse files
committed
Added back "Swiftmailer 6 support" to release as a new major version
This reverts commit 68d9bfa.
1 parent cfd59fb commit f25687b

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"eml"
1717
],
1818
"require": {
19-
"swiftmailer/swiftmailer": "~4.3|~5"
19+
"swiftmailer/swiftmailer": "~4.3|~5|~6"
2020
},
2121
"autoload": {
2222
"psr-4": {

src/SwiftMailer/Transport/FileTransport.php

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Geekdevs\SwiftMailer\Transport;
33

44
use Swift_Events_EventListener;
5+
use Swift_Mime_SimpleMessage as Swift_Mime_Message;
56
use Swift_Transport;
67
use Swift_IoException;
78

@@ -80,12 +81,12 @@ public function stop()
8081
/**
8182
* Sends the given message.
8283
*
83-
* @param \Swift_Mime_Message $message
84+
* @param Swift_Mime_Message $message
8485
* @param string[] $failedRecipients An array of failures by-reference
8586
*
8687
* @return int The number of sent emails
8788
*/
88-
public function send(\Swift_Mime_Message $message, &$failedRecipients = null)
89+
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
8990
{
9091
if ($evt = $this->eventDispatcher->createSendEvent($this, $message)) {
9192
$this->eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed');
@@ -111,12 +112,12 @@ public function send(\Swift_Mime_Message $message, &$failedRecipients = null)
111112
}
112113

113114
/**
114-
* @param \Swift_Mime_Message $message
115+
* @param Swift_Mime_Message $message
115116
* @param null $failedRecipients
116117
* @return bool
117118
* @throws Swift_IoException
118119
*/
119-
protected function doSend(\Swift_Mime_Message $message, &$failedRecipients = null)
120+
protected function doSend(Swift_Mime_Message $message, &$failedRecipients = null)
120121
{
121122
$body = $message->toString();
122123
$fileName = $this->path.'/'.date('Y-m-d H:i:s');
@@ -163,13 +164,29 @@ protected function getRandomString($count)
163164
return $ret;
164165
}
165166

166-
/**
167-
* @inheritdoc
168-
*
169-
* @return bool TRUE if the transport is alive
170-
*/
171-
public function ping()
172-
{
173-
return true;
174-
}
167+
/**
168+
* Check if this Transport mechanism is alive.
169+
*
170+
* If a Transport mechanism session is no longer functional, the method
171+
* returns FALSE. It is the responsibility of the developer to handle this
172+
* case and restart the Transport mechanism manually.
173+
*
174+
* @example
175+
*
176+
* if (!$transport->ping()) {
177+
* $transport->stop();
178+
* $transport->start();
179+
* }
180+
*
181+
* The Transport mechanism will be started, if it is not already.
182+
*
183+
* It is undefined if the Transport mechanism attempts to restart as long as
184+
* the return value reflects whether the mechanism is now functional.
185+
*
186+
* @return bool TRUE if the transport is alive
187+
*/
188+
public function ping()
189+
{
190+
return true;
191+
}
175192
}

0 commit comments

Comments
 (0)