From b1c23560565423251389b754643b44b710792239 Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Mon, 31 Dec 2018 08:09:33 +0100 Subject: [PATCH] BUGFIX: Require Swift_Transport instead of TransportInterface With TransportInterface as return type, original SwiftMailer transports could not be created --- Classes/TransportFactory.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/TransportFactory.php b/Classes/TransportFactory.php index a438b6d..d07a320 100644 --- a/Classes/TransportFactory.php +++ b/Classes/TransportFactory.php @@ -27,11 +27,11 @@ class TransportFactory * @param string $transportType Object name of the transport to create * @param array $transportOptions Options for the transport * @param array $transportArguments Constructor arguments for the transport - * @return TransportInterface The created transport instance + * @return \Swift_Transport The created transport instance * @throws Exception * @throws \ReflectionException */ - public function create(string $transportType, array $transportOptions = [], array $transportArguments = null): TransportInterface + public function create(string $transportType, array $transportOptions = [], array $transportArguments = null): \Swift_Transport { if (!class_exists($transportType)) { throw new Exception(sprintf('The specified transport backend "%s" does not exist.', $transportType), 1269351207); @@ -44,7 +44,7 @@ public function create(string $transportType, array $transportOptions = [], arra $transport = new $transportType(); } - if ($transport instanceof TransportInterface) { + if ($transport instanceof \Swift_Transport) { foreach ($transportOptions as $optionName => $optionValue) { if (ObjectAccess::isPropertySettable($transport, $optionName)) { ObjectAccess::setProperty($transport, $optionName, $optionValue); @@ -54,6 +54,6 @@ public function create(string $transportType, array $transportOptions = [], arra return $transport; } - throw new Exception(sprintf('The specified transport backend "%s" does not implement %s.', $transportType, TransportInterface::class), 1544727431); + throw new Exception(sprintf('The specified transport backend "%s" does not implement %s.', $transportType, \Swift_Transport::class), 1544727431); } }