Skip to content

Commit 4ecd57d

Browse files
committed
wire a clock for the BlueSky transport in the FrameworkBundle
1 parent 916718c commit 4ecd57d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,6 +2865,12 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
28652865
->addArgument(new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
28662866
}
28672867

2868+
if (ContainerBuilder::willBeAvailable('symfony/bluesky-notifier', NotifierBridge\BlueSky\BlueSkyTransportFactory::class, ['symfony/framework-bundle', 'symfony/notifier'])) {
2869+
$container->getDefinition($classToServices[NotifierBridge\Bluesky\BlueskyTransportFactory::class])
2870+
->addArgument(new Reference('logger'))
2871+
->addArgument(new Reference('clock', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
2872+
}
2873+
28682874
if (isset($config['admin_recipients'])) {
28692875
$notifier = $container->getDefinition('notifier');
28702876
foreach ($config['admin_recipients'] as $i => $recipient) {

src/Symfony/Component/Notifier/Bridge/Bluesky/BlueskyTransportFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Psr\Log\LoggerInterface;
1515
use Psr\Log\NullLogger;
16+
use Symfony\Component\Clock\ClockInterface;
1617
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
1718
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
1819
use Symfony\Component\Notifier\Transport\Dsn;
@@ -28,6 +29,7 @@ public function __construct(
2829
?EventDispatcherInterface $dispatcher = null,
2930
?HttpClientInterface $client = null,
3031
private ?LoggerInterface $logger = null,
32+
private readonly ?ClockInterface $clock = null,
3133
) {
3234
parent::__construct($dispatcher, $client);
3335
}
@@ -43,7 +45,7 @@ public function create(Dsn $dsn): BlueskyTransport
4345
$user = $this->getUser($dsn);
4446
$secret = $this->getPassword($dsn);
4547

46-
return (new BlueskyTransport($user, $secret, $this->logger ?? new NullLogger(), $this->client, $this->dispatcher))
48+
return (new BlueskyTransport($user, $secret, $this->logger ?? new NullLogger(), $this->client, $this->dispatcher, $this->clock))
4749
->setHost($dsn->getHost())
4850
->setPort($dsn->getPort());
4951
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy