simplify Dispatcher and EventDispatcher docblocks

v4
fadrian06 13 hours ago
parent 74c8e456b6
commit 1246c64d99

@ -74,13 +74,6 @@ class Dispatcher
);
}
/**
* Sets the engine instance
*
* @param Engine<EngineTemplate> $engine Flight instance
*
* @return void
*/
public function setEngine(Engine $engine): void
{
$this->engine = $engine;
@ -158,14 +151,7 @@ class Dispatcher
return $output;
}
/**
* Assigns a callback to an event.
*
* @param string $name Event name.
* @param callable(): (void|mixed) $callback Callback function.
*
* @return $this
*/
/** Assigns a callback to an event */
public function set(string $name, callable $callback): self
{
$this->events[$name] = $callback;
@ -173,13 +159,7 @@ class Dispatcher
return $this;
}
/**
* Gets an assigned callback.
*
* @param string $name Event name.
*
* @return null|(callable(): (void|mixed)) $callback Callback function.
*/
/** Gets an assigned callback */
public function get(string $name): ?callable
{
return $this->events[$name] ?? null;
@ -498,11 +478,7 @@ class Dispatcher
}
}
/**
* Resets the object to the initial state.
*
* @return $this
*/
/** Resets the object to the initial state */
public function reset(): self
{
$this->events = [];

@ -12,7 +12,7 @@ class EventDispatcher
/** @var array<string, array<int, callable(): mixed>> */
protected array $listeners = [];
/** Singleton instance of the EventDispatcher. */
/** Singleton instance of the EventDispatcher */
public static function getInstance(): self
{
if (!self::$instance) {

Loading…
Cancel
Save