added some callable prototypes for phpstan

This commit is contained in:
Dylan K. Taylor
2020-01-29 19:56:16 +00:00
parent 68bea6d4aa
commit 5c4487c980
10 changed files with 64 additions and 7 deletions

View File

@@ -499,6 +499,7 @@ class PluginManager{
}
}
/** @phpstan-var \ReflectionClass<Event> $eventClass */
$this->registerEvent($eventClass->getName(), $handlerClosure, $priority, $plugin, $handleCancelled);
}
}
@@ -507,6 +508,10 @@ class PluginManager{
/**
* @param string $event Class name that extends Event
*
* @phpstan-template TEvent of Event
* @phpstan-param class-string<TEvent> $event
* @phpstan-param \Closure(TEvent) : void $handler
*
* @throws \ReflectionException
*/
public function registerEvent(string $event, \Closure $handler, int $priority, Plugin $plugin, bool $handleCancelled = false) : void{