Improved ListenerProviderFactoryTest

This commit is contained in:
Alejandro Celaya
2019-07-19 20:28:28 +02:00
parent d086131630
commit af40e8de5c
4 changed files with 92 additions and 10 deletions

View File

@@ -31,6 +31,10 @@ class ListenerProviderFactory implements FactoryInterface
AttachableListenerProvider $provider,
bool $isAsync = false
): void {
if (empty($events)) {
return;
}
// Avoid registering async event listeners when the swoole server is not registered
if ($isAsync && ! $container->has(HttpServer::class)) {
return;