[Mailer] Tweak some code
This commit is contained in:
parent
3a1d36102f
commit
ab094c02eb
@ -35,7 +35,7 @@ class RoundRobinTransport implements TransportInterface
|
|||||||
public function __construct(array $transports, int $retryPeriod = 60)
|
public function __construct(array $transports, int $retryPeriod = 60)
|
||||||
{
|
{
|
||||||
if (!$transports) {
|
if (!$transports) {
|
||||||
throw new TransportException(__CLASS__.' must have at least one transport configured.');
|
throw new TransportException(sprintf('"%s" must have at least one transport configured.', static::class));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->transports = $transports;
|
$this->transports = $transports;
|
||||||
@ -58,9 +58,7 @@ class RoundRobinTransport implements TransportInterface
|
|||||||
|
|
||||||
public function __toString(): string
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return $this->getNameSymbol().'('.implode(' ', array_map(function (TransportInterface $transport) {
|
return $this->getNameSymbol().'('.implode(' ', array_map('strval', $this->transports)).')';
|
||||||
return (string) $transport;
|
|
||||||
}, $this->transports)).')';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@ use Symfony\Component\Mime\RawMessage;
|
|||||||
/**
|
/**
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class Transports implements TransportInterface
|
final class Transports implements TransportInterface
|
||||||
{
|
{
|
||||||
private $transports;
|
private $transports;
|
||||||
private $default;
|
private $default;
|
||||||
@ -64,6 +64,6 @@ class Transports implements TransportInterface
|
|||||||
|
|
||||||
public function __toString(): string
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'all';
|
return '['.implode(',', array_keys($this->transports)).']';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user