diff --git a/src/event/AsyncRegisteredListener.php b/src/event/AsyncRegisteredListener.php index 1d0f65b71..81be52f73 100644 --- a/src/event/AsyncRegisteredListener.php +++ b/src/event/AsyncRegisteredListener.php @@ -30,7 +30,7 @@ use function in_array; class AsyncRegisteredListener{ /** - * @phpstan-param \Closure(AsyncEvent) : Promise $handler + * @phpstan-param \Closure(AsyncEvent) : ?Promise $handler */ public function __construct( private \Closure $handler, diff --git a/src/plugin/PluginManager.php b/src/plugin/PluginManager.php index 8c99e9f40..85167447b 100644 --- a/src/plugin/PluginManager.php +++ b/src/plugin/PluginManager.php @@ -697,8 +697,9 @@ class PluginManager{ /** * @param string $event Class name that extends Event and AsyncEvent * - * @phpstan-param class-string $event - * @phpstan-param \Closure(AsyncEvent) : Promise $handler + * @phpstan-template TEvent of AsyncEvent + * @phpstan-param class-string $event + * @phpstan-param \Closure(TEvent) : ?Promise $handler * * @throws \ReflectionException */