Skip to content

Commit f391aff

Browse files
committed
Allow listeners added via config to be compiled in container by making them factories
1 parent d2c68e0 commit f391aff

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Event/functions.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66

77
if (!function_exists('PhpSchool\PhpWorkshop\Event\containerListener')) {
88

9-
/**
10-
* @param string $service
11-
* @param string $method
12-
* @return ContainerListenerHelper
13-
*/
14-
function containerListener(string $service, string $method = '__invoke')
9+
function containerListener(string $service, string $method = '__invoke'): callable
1510
{
16-
return new ContainerListenerHelper($service, $method);
11+
return fn () => new ContainerListenerHelper($service, $method);
1712
}
1813
}

0 commit comments

Comments
 (0)