Skip to content

Commit c85b3e5

Browse files
authored
[11.x] Fix docblocks for code that calls enum_value() (#54432)
* Bus Queueable * other instances of BackedEnum * remove redundant template
1 parent fcd058f commit c85b3e5

File tree

10 files changed

+25
-25
lines changed

10 files changed

+25
-25
lines changed

src/Illuminate/Auth/Access/Gate.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected function authorizeOnDemand($condition, $message, $code, $allowWhenResp
194194
/**
195195
* Define a new ability.
196196
*
197-
* @param \BackedEnum|string $ability
197+
* @param \UnitEnum|string $ability
198198
* @param callable|array|string $callback
199199
* @return $this
200200
*
@@ -325,7 +325,7 @@ public function after(callable $callback)
325325
/**
326326
* Determine if all of the given abilities should be granted for the current user.
327327
*
328-
* @param iterable|\BackedEnum|string $ability
328+
* @param iterable|\UnitEnum|string $ability
329329
* @param array|mixed $arguments
330330
* @return bool
331331
*/
@@ -337,7 +337,7 @@ public function allows($ability, $arguments = [])
337337
/**
338338
* Determine if any of the given abilities should be denied for the current user.
339339
*
340-
* @param iterable|\BackedEnum|string $ability
340+
* @param iterable|\UnitEnum|string $ability
341341
* @param array|mixed $arguments
342342
* @return bool
343343
*/
@@ -349,7 +349,7 @@ public function denies($ability, $arguments = [])
349349
/**
350350
* Determine if all of the given abilities should be granted for the current user.
351351
*
352-
* @param iterable|\BackedEnum|string $abilities
352+
* @param iterable|\UnitEnum|string $abilities
353353
* @param array|mixed $arguments
354354
* @return bool
355355
*/
@@ -363,7 +363,7 @@ public function check($abilities, $arguments = [])
363363
/**
364364
* Determine if any one of the given abilities should be granted for the current user.
365365
*
366-
* @param iterable|\BackedEnum|string $abilities
366+
* @param iterable|\UnitEnum|string $abilities
367367
* @param array|mixed $arguments
368368
* @return bool
369369
*/
@@ -375,7 +375,7 @@ public function any($abilities, $arguments = [])
375375
/**
376376
* Determine if all of the given abilities should be denied for the current user.
377377
*
378-
* @param iterable|\BackedEnum|string $abilities
378+
* @param iterable|\UnitEnum|string $abilities
379379
* @param array|mixed $arguments
380380
* @return bool
381381
*/
@@ -387,7 +387,7 @@ public function none($abilities, $arguments = [])
387387
/**
388388
* Determine if the given ability should be granted for the current user.
389389
*
390-
* @param \BackedEnum|string $ability
390+
* @param \UnitEnum|string $ability
391391
* @param array|mixed $arguments
392392
* @return \Illuminate\Auth\Access\Response
393393
*
@@ -401,7 +401,7 @@ public function authorize($ability, $arguments = [])
401401
/**
402402
* Inspect the user for the given ability.
403403
*
404-
* @param \BackedEnum|string $ability
404+
* @param \UnitEnum|string $ability
405405
* @param array|mixed $arguments
406406
* @return \Illuminate\Auth\Access\Response
407407
*/

src/Illuminate/Auth/Middleware/Authorize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(Gate $gate)
3232
/**
3333
* Specify the ability and models for the middleware.
3434
*
35-
* @param \BackedEnum|string $ability
35+
* @param \UnitEnum|string $ability
3636
* @param string ...$models
3737
* @return string
3838
*/

src/Illuminate/Bus/PendingBatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function connection()
263263
/**
264264
* Specify the queue that the batched jobs should run on.
265265
*
266-
* @param \BackedEnum|string|null $queue
266+
* @param \UnitEnum|string|null $queue
267267
* @return $this
268268
*/
269269
public function onQueue($queue)

src/Illuminate/Bus/Queueable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ trait Queueable
7979
/**
8080
* Set the desired connection for the job.
8181
*
82-
* @param \BackedEnum|string|null $connection
82+
* @param \UnitEnum|string|null $connection
8383
* @return $this
8484
*/
8585
public function onConnection($connection)
@@ -92,7 +92,7 @@ public function onConnection($connection)
9292
/**
9393
* Set the desired queue for the job.
9494
*
95-
* @param \BackedEnum|string|null $queue
95+
* @param \UnitEnum|string|null $queue
9696
* @return $this
9797
*/
9898
public function onQueue($queue)
@@ -105,7 +105,7 @@ public function onQueue($queue)
105105
/**
106106
* Set the desired connection for the chain.
107107
*
108-
* @param \BackedEnum|string|null $connection
108+
* @param \UnitEnum|string|null $connection
109109
* @return $this
110110
*/
111111
public function allOnConnection($connection)
@@ -121,7 +121,7 @@ public function allOnConnection($connection)
121121
/**
122122
* Set the desired queue for the chain.
123123
*
124-
* @param \BackedEnum|string|null $queue
124+
* @param \UnitEnum|string|null $queue
125125
* @return $this
126126
*/
127127
public function allOnQueue($queue)

src/Illuminate/Database/Eloquent/Casts/AsEnumArrayObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AsEnumArrayObject implements Castable
1414
/**
1515
* Get the caster class to use when casting from / to this cast target.
1616
*
17-
* @template TEnum
17+
* @template TEnum of \UnitEnum
1818
*
1919
* @param array{class-string<TEnum>} $arguments
2020
* @return \Illuminate\Contracts\Database\Eloquent\CastsAttributes<\Illuminate\Database\Eloquent\Casts\ArrayObject<array-key, TEnum>, iterable<TEnum>>

src/Illuminate/Database/Eloquent/Casts/AsEnumCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AsEnumCollection implements Castable
1414
/**
1515
* Get the caster class to use when casting from / to this cast target.
1616
*
17-
* @template TEnum of \UnitEnum|\BackedEnum
17+
* @template TEnum of \UnitEnum
1818
*
1919
* @param array{class-string<TEnum>} $arguments
2020
* @return \Illuminate\Contracts\Database\Eloquent\CastsAttributes<\Illuminate\Support\Collection<array-key, TEnum>, iterable<TEnum>>

src/Illuminate/Events/QueuedClosure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ public function __construct(Closure $closure)
5959
/**
6060
* Set the desired connection for the job.
6161
*
62-
* @param string|null $connection
62+
* @param \UnitEnum|string|null $connection
6363
* @return $this
6464
*/
6565
public function onConnection($connection)
6666
{
67-
$this->connection = $connection;
67+
$this->connection = enum_value($connection);
6868

6969
return $this;
7070
}
7171

7272
/**
7373
* Set the desired queue for the job.
7474
*
75-
* @param \BackedEnum|string|null $queue
75+
* @param \UnitEnum|string|null $queue
7676
* @return $this
7777
*/
7878
public function onQueue($queue)

src/Illuminate/Foundation/Bus/PendingChain.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ public function __construct($job, $chain)
7272
/**
7373
* Set the desired connection for the job.
7474
*
75-
* @param string|null $connection
75+
* @param \UnitEnum|string|null $connection
7676
* @return $this
7777
*/
7878
public function onConnection($connection)
7979
{
80-
$this->connection = $connection;
80+
$this->connection = enum_value($connection);
8181

8282
return $this;
8383
}
8484

8585
/**
8686
* Set the desired queue for the job.
8787
*
88-
* @param \BackedEnum|string|null $queue
88+
* @param \UnitEnum|string|null $queue
8989
* @return $this
9090
*/
9191
public function onQueue($queue)

src/Illuminate/Routing/Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ public function middleware($middleware = null)
10851085
/**
10861086
* Specify that the "Authorize" / "can" middleware should be applied to the route with the given options.
10871087
*
1088-
* @param \BackedEnum|string $ability
1088+
* @param \UnitEnum|string $ability
10891089
* @param array|string $models
10901090
* @return $this
10911091
*/

src/Illuminate/Validation/Rules/DatabaseRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function resolveTableName($table)
8484
* Set a "where" constraint on the query.
8585
*
8686
* @param \Closure|string $column
87-
* @param \Illuminate\Contracts\Support\Arrayable|\BackedEnum|\Closure|array|string|int|bool|null $value
87+
* @param \Illuminate\Contracts\Support\Arrayable|\UnitEnum|\Closure|array|string|int|bool|null $value
8888
* @return $this
8989
*/
9090
public function where($column, $value = null)
@@ -112,7 +112,7 @@ public function where($column, $value = null)
112112
* Set a "where not" constraint on the query.
113113
*
114114
* @param string $column
115-
* @param \Illuminate\Contracts\Support\Arrayable|\BackedEnum|array|string $value
115+
* @param \Illuminate\Contracts\Support\Arrayable|\UnitEnum|array|string $value
116116
* @return $this
117117
*/
118118
public function whereNot($column, $value)

0 commit comments

Comments
 (0)