From 47a49b1032971388e3d5c61b05ea05e35f09fb98 Mon Sep 17 00:00:00 2001 From: sergiu Date: Thu, 5 Dec 2024 09:22:17 +0200 Subject: [PATCH] removed extends key and inherited code related to it Signed-off-by: sergiu --- config/mail.global.php.dist | 2 -- src/Factory/MailOptionsAbstractFactory.php | 23 ---------------------- test/CommonTrait.php | 2 -- 3 files changed, 27 deletions(-) diff --git a/config/mail.global.php.dist b/config/mail.global.php.dist index 73efaeb..5ed3c08 100644 --- a/config/mail.global.php.dist +++ b/config/mail.global.php.dist @@ -14,8 +14,6 @@ return [ 'dot_mail' => [ //the key is the mail service name, this is the default one, which does not extends any configuration 'default' => [ - //tells which other mail service configuration to extend - 'extends' => null, /** * the mail transport to use * can be any class implementing Symfony\Component\Mailer\Transport\TransportInterface diff --git a/src/Factory/MailOptionsAbstractFactory.php b/src/Factory/MailOptionsAbstractFactory.php index 856ddbf..0d1fb56 100644 --- a/src/Factory/MailOptionsAbstractFactory.php +++ b/src/Factory/MailOptionsAbstractFactory.php @@ -5,16 +5,12 @@ namespace Dot\Mail\Factory; use Dot\Mail\Options\MailOptions; -use Laminas\Stdlib\ArrayUtils; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; -use function array_key_exists; use function explode; use function is_array; -use function is_string; -use function trim; class MailOptionsAbstractFactory extends AbstractMailFactory { @@ -35,25 +31,6 @@ public function __invoke(ContainerInterface $container, $requestedName, ?array $ $specificConfig = []; } - /** - * Merge any extended mail service config into this one - */ - do { - $extendsConfigKey = isset($specificConfig['extends']) && is_string($specificConfig['extends']) - ? trim($specificConfig['extends']) - : null; - - unset($specificConfig['extends']); - - if ( - $extendsConfigKey !== null - && array_key_exists($extendsConfigKey, $config) - && is_array($config[$extendsConfigKey]) - ) { - $specificConfig = ArrayUtils::merge($config[$extendsConfigKey], $specificConfig); - } - } while ($extendsConfigKey !== null); - return new MailOptions($specificConfig); } } diff --git a/test/CommonTrait.php b/test/CommonTrait.php index 6b7e637..09fda28 100644 --- a/test/CommonTrait.php +++ b/test/CommonTrait.php @@ -46,8 +46,6 @@ private function generateConfig(): array return [ 'dot_mail' => [ 'default' => [ - 'extends' => null, - /** * the mail transport to use * can be any class implementing Symfony\Component\Mailer\Transport\TransportInterface