Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event name & listener callback types #53642

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/Illuminate/Database/Eloquent/Concerns/HasEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function removeObservableEvents($observables)
* Register a model event with the dispatcher.
*
* @param string $event
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
protected static function registerModelEvent($event, $callback)
Expand Down Expand Up @@ -266,7 +266,7 @@ protected function filterModelEventResults($result)
/**
* Register a retrieved model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function retrieved($callback)
Expand All @@ -277,7 +277,7 @@ public static function retrieved($callback)
/**
* Register a saving model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function saving($callback)
Expand All @@ -288,7 +288,7 @@ public static function saving($callback)
/**
* Register a saved model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function saved($callback)
Expand All @@ -299,7 +299,7 @@ public static function saved($callback)
/**
* Register an updating model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function updating($callback)
Expand All @@ -310,7 +310,7 @@ public static function updating($callback)
/**
* Register an updated model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function updated($callback)
Expand All @@ -321,7 +321,7 @@ public static function updated($callback)
/**
* Register a creating model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function creating($callback)
Expand All @@ -332,7 +332,7 @@ public static function creating($callback)
/**
* Register a created model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function created($callback)
Expand All @@ -343,7 +343,7 @@ public static function created($callback)
/**
* Register a replicating model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function replicating($callback)
Expand All @@ -354,7 +354,7 @@ public static function replicating($callback)
/**
* Register a deleting model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function deleting($callback)
Expand All @@ -365,7 +365,7 @@ public static function deleting($callback)
/**
* Register a deleted model event with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
* @return void
*/
public static function deleted($callback)
Expand Down
10 changes: 5 additions & 5 deletions src/Illuminate/Database/Eloquent/SoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function trashed()
/**
* Register a "softDeleted" model event callback with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
* @return void
*/
public static function softDeleted($callback)
Expand All @@ -221,7 +221,7 @@ public static function softDeleted($callback)
/**
* Register a "restoring" model event callback with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
* @return void
*/
public static function restoring($callback)
Expand All @@ -232,7 +232,7 @@ public static function restoring($callback)
/**
* Register a "restored" model event callback with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
* @return void
*/
public static function restored($callback)
Expand All @@ -243,7 +243,7 @@ public static function restored($callback)
/**
* Register a "forceDeleting" model event callback with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
* @return void
*/
public static function forceDeleting($callback)
Expand All @@ -254,7 +254,7 @@ public static function forceDeleting($callback)
/**
* Register a "forceDeleted" model event callback with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
* @return void
*/
public static function forceDeleted($callback)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Events/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function __construct(?ContainerContract $container = null)
/**
* Register an event listener with the dispatcher.
*
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $events
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array|null $listener
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string|string $events
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string|null $listener
* @return void
*/
public function listen($events, $listener = null)
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Facades/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Testing\Fakes\EventFake;

/**
* @method static void listen(\Illuminate\Events\QueuedClosure|\Closure|string|array $events, \Illuminate\Events\QueuedClosure|\Closure|string|array|null $listener = null)
* @method static void listen(\Illuminate\Events\QueuedClosure|callable|array|class-string|string $events, \Illuminate\Events\QueuedClosure|callable|array|class-string|null $listener = null)
* @method static bool hasListeners(string $eventName)
* @method static bool hasWildcardListeners(string $eventName)
* @method static void push(string $event, object|array $payload = [])
Expand Down