18
18
19
19
use function Illuminate \Support \enum_value ;
20
20
21
+ /**
22
+ * @template TClass of object
23
+ */
21
24
class Gate implements GateContract
22
25
{
23
26
use HandlesAuthorization;
@@ -326,7 +329,7 @@ public function after(callable $callback)
326
329
* Determine if all of the given abilities should be granted for the current user.
327
330
*
328
331
* @param iterable|\UnitEnum|string $ability
329
- * @param mixed $arguments
332
+ * @param array{class-string<TClass>|TClass, ...} $arguments
330
333
* @return bool
331
334
*/
332
335
public function allows ($ ability , $ arguments = [])
@@ -338,7 +341,7 @@ public function allows($ability, $arguments = [])
338
341
* Determine if any of the given abilities should be denied for the current user.
339
342
*
340
343
* @param iterable|\UnitEnum|string $ability
341
- * @param mixed $arguments
344
+ * @param array{class-string<TClass>|TClass, ...} $arguments
342
345
* @return bool
343
346
*/
344
347
public function denies ($ ability , $ arguments = [])
@@ -350,7 +353,7 @@ public function denies($ability, $arguments = [])
350
353
* Determine if all of the given abilities should be granted for the current user.
351
354
*
352
355
* @param iterable|\UnitEnum|string $abilities
353
- * @param mixed $arguments
356
+ * @param array{class-string<TClass>|TClass, ...} $arguments
354
357
* @return bool
355
358
*/
356
359
public function check ($ abilities , $ arguments = [])
@@ -364,7 +367,7 @@ public function check($abilities, $arguments = [])
364
367
* Determine if any one of the given abilities should be granted for the current user.
365
368
*
366
369
* @param iterable|\UnitEnum|string $abilities
367
- * @param mixed $arguments
370
+ * @param array{class-string<TClass>|TClass, ...} $arguments
368
371
* @return bool
369
372
*/
370
373
public function any ($ abilities , $ arguments = [])
@@ -376,7 +379,7 @@ public function any($abilities, $arguments = [])
376
379
* Determine if all of the given abilities should be denied for the current user.
377
380
*
378
381
* @param iterable|\UnitEnum|string $abilities
379
- * @param mixed $arguments
382
+ * @param array{class-string<TClass>|TClass, ...} $arguments
380
383
* @return bool
381
384
*/
382
385
public function none ($ abilities , $ arguments = [])
@@ -388,7 +391,7 @@ public function none($abilities, $arguments = [])
388
391
* Determine if the given ability should be granted for the current user.
389
392
*
390
393
* @param \UnitEnum|string $ability
391
- * @param mixed $arguments
394
+ * @param array{class-string<TClass>|TClass, ...} $arguments
392
395
* @return \Illuminate\Auth\Access\Response
393
396
*
394
397
* @throws \Illuminate\Auth\Access\AuthorizationException
@@ -402,7 +405,7 @@ public function authorize($ability, $arguments = [])
402
405
* Inspect the user for the given ability.
403
406
*
404
407
* @param \UnitEnum|string $ability
405
- * @param array|mixed $arguments
408
+ * @param array{class-string<TClass>|TClass, ...} $arguments
406
409
* @return \Illuminate\Auth\Access\Response
407
410
*/
408
411
public function inspect ($ ability , $ arguments = [])
@@ -426,7 +429,7 @@ public function inspect($ability, $arguments = [])
426
429
* Get the raw result from the authorization callback.
427
430
*
428
431
* @param string $ability
429
- * @param array|mixed $arguments
432
+ * @param array{class-string<TClass>|TClass, ...} $arguments
430
433
* @return mixed
431
434
*
432
435
* @throws \Illuminate\Auth\Access\AuthorizationException
0 commit comments