Skip to content

Commit 9516c7e

Browse files
committed
[Mailer] Restore Transport signatures
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent 2113aa6 commit 9516c7e

File tree

1 file changed

+4
-32
lines changed

1 file changed

+4
-32
lines changed

Transport.php

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@
3838
/**
3939
* @author Fabien Potencier <fabien@symfony.com>
4040
* @author Konstantin Myakshin <molodchick@gmail.com>
41-
*
42-
* @final since Symfony 5.4
4341
*/
44-
class Transport
42+
final class Transport
4543
{
4644
private const FACTORY_CLASSES = [
4745
GmailTransportFactory::class,
@@ -56,33 +54,15 @@ class Transport
5654

5755
private $factories;
5856

59-
/**
60-
* @param EventDispatcherInterface|null $dispatcher
61-
* @param HttpClientInterface|null $client
62-
* @param LoggerInterface|null $logger
63-
*/
64-
public static function fromDsn(string $dsn/*, EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null*/): TransportInterface
57+
public static function fromDsn(string $dsn, EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null): TransportInterface
6558
{
66-
$dispatcher = 2 <= \func_num_args() ? func_get_arg(1) : null;
67-
$client = 3 <= \func_num_args() ? func_get_arg(2) : null;
68-
$logger = 4 <= \func_num_args() ? func_get_arg(3) : null;
69-
7059
$factory = new self(iterator_to_array(self::getDefaultFactories($dispatcher, $client, $logger)));
7160

7261
return $factory->fromString($dsn);
7362
}
7463

75-
/**
76-
* @param EventDispatcherInterface|null $dispatcher
77-
* @param HttpClientInterface|null $client
78-
* @param LoggerInterface|null $logger
79-
*/
80-
public static function fromDsns(array $dsns/*, EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null*/): TransportInterface
64+
public static function fromDsns(array $dsns, EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null): TransportInterface
8165
{
82-
$dispatcher = 2 <= \func_num_args() ? func_get_arg(1) : null;
83-
$client = 3 <= \func_num_args() ? func_get_arg(2) : null;
84-
$logger = 4 <= \func_num_args() ? func_get_arg(3) : null;
85-
8666
$factory = new self(iterator_to_array(self::getDefaultFactories($dispatcher, $client, $logger)));
8767

8868
return $factory->fromStrings($dsns);
@@ -175,18 +155,10 @@ public function fromDsnObject(Dsn $dsn): TransportInterface
175155
}
176156

177157
/**
178-
* @param EventDispatcherInterface|null $dispatcher
179-
* @param HttpClientInterface|null $client
180-
* @param LoggerInterface|null $logger
181-
*
182158
* @return \Traversable<int, TransportFactoryInterface>
183159
*/
184-
public static function getDefaultFactories(/*EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null*/): iterable
160+
public static function getDefaultFactories(EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null, LoggerInterface $logger = null): \Traversable
185161
{
186-
$dispatcher = 1 <= \func_num_args() ? func_get_arg(0) : null;
187-
$client = 2 <= \func_num_args() ? func_get_arg(1) : null;
188-
$logger = 3 <= \func_num_args() ? func_get_arg(2) : null;
189-
190162
foreach (self::FACTORY_CLASSES as $factoryClass) {
191163
if (class_exists($factoryClass)) {
192164
yield new $factoryClass($dispatcher, $client, $logger);

0 commit comments

Comments
 (0)