8000 bug #57435 [FrameworkBundle] wire a clock for the BlueSky transport i… · symfony/symfony@a86c96a · GitHub
[go: up one dir, main page]

Skip to content

Commit a86c96a

Browse files
committed
bug #57435 [FrameworkBundle] wire a clock for the BlueSky transport in the FrameworkBundle (xabbuh)
This PR was merged into the 7.2 branch. Discussion ---------- [FrameworkBundle] wire a clock for the BlueSky transport in the FrameworkBundle | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT following #57099 and #57434 Commits ------- 35f8cf5 wire a clock for the BlueSky transport in the FrameworkBundle
2 parents 41c6833 + 35f8cf5 commit a86c96a

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)
0