Skip to content

Commit 3f484c4

Browse files
event name & listener callback types (#53642)
* event name & listener callback types * formatting * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent a2bcf35 commit 3f484c4

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasEvents.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function removeObservableEvents($observables)
183183
* Register a model event with the dispatcher.
184184
*
185185
* @param string $event
186-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
186+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
187187
* @return void
188188
*/
189189
protected static function registerModelEvent($event, $callback)
@@ -266,7 +266,7 @@ protected function filterModelEventResults($result)
266266
/**
267267
* Register a retrieved model event with the dispatcher.
268268
*
269-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
269+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
270270
* @return void
271271
*/
272272
public static function retrieved($callback)
@@ -277,7 +277,7 @@ public static function retrieved($callback)
277277
/**
278278
* Register a saving model event with the dispatcher.
279279
*
280-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
280+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
281281
* @return void
282282
*/
283283
public static function saving($callback)
@@ -288,7 +288,7 @@ public static function saving($callback)
288288
/**
289289
* Register a saved model event with the dispatcher.
290290
*
291-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
291+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
292292
* @return void
293293
*/
294294
public static function saved($callback)
@@ -299,7 +299,7 @@ public static function saved($callback)
299299
/**
300300
* Register an updating model event with the dispatcher.
301301
*
302-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
302+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
303303
* @return void
304304
*/
305305
public static function updating($callback)
@@ -310,7 +310,7 @@ public static function updating($callback)
310310
/**
311311
* Register an updated model event with the dispatcher.
312312
*
313-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
313+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
314314
* @return void
315315
*/
316316
public static function updated($callback)
@@ -321,7 +321,7 @@ public static function updated($callback)
321321
/**
322322
* Register a creating model event with the dispatcher.
323323
*
324-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
324+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
325325
* @return void
326326
*/
327327
public static function creating($callback)
@@ -332,7 +332,7 @@ public static function creating($callback)
332332
/**
333333
* Register a created model event with the dispatcher.
334334
*
335-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
335+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
336336
* @return void
337337
*/
338338
public static function created($callback)
@@ -343,7 +343,7 @@ public static function created($callback)
343343
/**
344344
* Register a replicating model event with the dispatcher.
345345
*
346-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
346+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
347347
* @return void
348348
*/
349349
public static function replicating($callback)
@@ -354,7 +354,7 @@ public static function replicating($callback)
354354
/**
355355
* Register a deleting model event with the dispatcher.
356356
*
357-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
357+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
358358
* @return void
359359
*/
360360
public static function deleting($callback)
@@ -365,7 +365,7 @@ public static function deleting($callback)
365365
/**
366366
* Register a deleted model event with the dispatcher.
367367
*
368-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $callback
368+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string $callback
369369
* @return void
370370
*/
371371
public static function deleted($callback)

src/Illuminate/Database/Eloquent/SoftDeletes.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function trashed()
210210
/**
211211
* Register a "softDeleted" model event callback with the dispatcher.
212212
*
213-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
213+
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
214214
* @return void
215215
*/
216216
public static function softDeleted($callback)
@@ -221,7 +221,7 @@ public static function softDeleted($callback)
221221
/**
222222
* Register a "restoring" model event callback with the dispatcher.
223223
*
224-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
224+
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
225225
* @return void
226226
*/
227227
public static function restoring($callback)
@@ -232,7 +232,7 @@ public static function restoring($callback)
232232
/**
233233
* Register a "restored" model event callback with the dispatcher.
234234
*
235-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
235+
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
236236
* @return void
237237
*/
238238
public static function restored($callback)
@@ -243,7 +243,7 @@ public static function restored($callback)
243243
/**
244244
* Register a "forceDeleting" model event callback with the dispatcher.
245245
*
246-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
246+
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
247247
* @return void
248248
*/
249249
public static function forceDeleting($callback)
@@ -254,7 +254,7 @@ public static function forceDeleting($callback)
254254
/**
255255
* Register a "forceDeleted" model event callback with the dispatcher.
256256
*
257-
* @param \Illuminate\Events\QueuedClosure|\Closure|string $callback
257+
* @param \Illuminate\Events\QueuedClosure|callable|class-string $callback
258258
* @return void
259259
*/
260260
public static function forceDeleted($callback)

src/Illuminate/Events/Dispatcher.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ public function __construct(?ContainerContract $container = null)
8080
/**
8181
* Register an event listener with the dispatcher.
8282
*
83-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array $events
84-
* @param \Illuminate\Events\QueuedClosure|\Closure|string|array|null $listener
83+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string|string $events
84+
* @param \Illuminate\Events\QueuedClosure|callable|array|class-string|null $listener
8585
* @return void
8686
*/
8787
public function listen($events, $listener = null)

src/Illuminate/Support/Facades/Event.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Illuminate\Support\Testing\Fakes\EventFake;
77

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

0 commit comments

Comments
 (0)