Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 648ed20

Browse filesBrowse files
committed
Autowire the PSR ClockInterface
1 parent a97d79a commit 648ed20
Copy full SHA for 648ed20

File tree

2 files changed

+4
-0
lines changed
Filter options

2 files changed

+4
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use PhpParser\Parser;
2121
use PHPStan\PhpDocParser\Parser\PhpDocParser;
2222
use Psr\Cache\CacheItemPoolInterface;
23+
use Psr\Clock\ClockInterface as PsrClockInterface;
2324
use Psr\Container\ContainerInterface as PsrContainerInterface;
2425
use Psr\Http\Client\ClientInterface;
2526
use Psr\Log\LoggerAwareInterface;
@@ -277,6 +278,7 @@ public function load(array $configs, ContainerBuilder $container)
277278
if (!ContainerBuilder::willBeAvailable('symfony/clock', ClockInterface::class, ['symfony/framework-bundle'])) {
278279
$container->removeDefinition('clock');
279280
$container->removeAlias(ClockInterface::class);
281+
$container->removeAlias(PsrClockInterface::class);
280282
}
281283

282284
$container->registerAliasForArgument('parameter_bag', PsrContainerInterface::class);

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/services.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/services.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

14+
use Psr\Clock\ClockInterface as PsrClockInterface;
1415
use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface;
1516
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ConfigBuilderCacheWarmer;
1617
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
@@ -230,6 +231,7 @@ class_exists(WorkflowEvents::class) ? WorkflowEvents::ALIASES : []
230231

231232
->set('clock', NativeClock::class)
232233
->alias(ClockInterface::class, 'clock')
234+
->alias(PsrClockInterface::class, 'clock')
233235

234236
// register as abstract and excluded, aka not-autowirable types
235237
->set(LoaderInterface::class)->abstract()->tag('container.excluded')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.