Skip to content

Commit

Permalink
removed extends key and inherited code related to it
Browse files Browse the repository at this point in the history
Signed-off-by: sergiu <[email protected]>
  • Loading branch information
SergiuBota1 committed Dec 5, 2024
1 parent 062b763 commit 47a49b1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
2 changes: 0 additions & 2 deletions config/mail.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 0 additions & 23 deletions src/Factory/MailOptionsAbstractFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}
}
2 changes: 0 additions & 2 deletions test/CommonTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47a49b1

Please sign in to comment.