Skip to content

Commit 1e44acd

Browse files
authored
Merge pull request #4 from apisearch-io/fix/event-loop-public
Event Loop service is public
2 parents f509c66 + 00e096b commit 1e44acd

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

AsyncKernel.php

+14-7
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,27 @@ public function handleAsync(
6767
*/
6868
public function process(ContainerBuilder $container)
6969
{
70-
$container
71-
->getDefinition('event_dispatcher')
72-
->setClass(AsyncEventDispatcher::class);
70+
if ($container->has('event_dispatcher')) {
71+
$container
72+
->getDefinition('event_dispatcher')
73+
->setClass(AsyncEventDispatcher::class);
74+
}
7375

74-
$container
75-
->getDefinition('http_kernel')
76-
->setClass(AsyncHttpKernel::class);
76+
if ($container->has('http_kernel')) {
77+
$container
78+
->getDefinition('http_kernel')
79+
->setClass(AsyncHttpKernel::class);
80+
}
7781

7882
if (!$container->has('reactphp.event_loop')) {
7983
$loop = new Definition(LoopInterface::class);
8084
$loop->setSynthetic(true);
85+
$loop->setPublic(true);
8186
$container->setDefinition('reactphp.event_loop', $loop);
8287
}
8388

84-
$container->setAlias(LoopInterface::class, 'reactphp.event_loop');
89+
if ($container->has('reactphp.event_loop')) {
90+
$container->setAlias(LoopInterface::class, 'reactphp.event_loop');
91+
}
8592
}
8693
}

0 commit comments

Comments
 (0)