24
24
* @method void configureJob(JobDecorator|UniqueJobDecorator $job)
25
25
*
26
26
* @property-read int|array $jobBackoff
27
- * @method int|array getJobBackoff(...$parameters )
27
+ * @method int|array getJobBackoff()
28
28
*
29
29
* @property-read \DateTime|int $jobRetryUntil
30
- * @method \DateTime|int getJobRetryUntil(...$parameters )
30
+ * @method \DateTime|int getJobRetryUntil()
31
31
*
32
- * @method array getJobMiddleware(...$parameters )
32
+ * @method array getJobMiddleware()
33
33
*
34
- * @method void jobFailed(Throwable $e, ...$parameters )
34
+ * @method void jobFailed(Throwable $e)
35
35
*
36
- * @method string getJobDisplayName(...$parameters )
36
+ * @method string getJobDisplayName()
37
37
*
38
- * @method array getJobTags(...$parameters )
38
+ * @method array getJobTags()
39
39
*
40
40
* @property-read int $jobUniqueFor
41
- * @method int getJobUniqueFor(...$parameters )
41
+ * @method int getJobUniqueFor()
42
42
*
43
43
* @property-read int $jobUniqueId
44
- * @method int getJobUniqueId(...$parameters )
44
+ * @method int getJobUniqueId()
45
45
*
46
- * @method int getJobUniqueVia(...$parameters)
46
+ * @method int getJobUniqueVia()
47
+ *
48
+ * @property-read bool $jobDeleteWhenMissingModels
49
+ * @method bool getJobDeleteWhenMissingModels()
47
50
*
48
51
*/
49
52
trait AsJob
50
53
{
51
- /**
52
- * @param mixed ...$arguments
53
- * @return JobDecorator|UniqueJobDecorator
54
- */
55
- public static function makeJob (...$ arguments ): JobDecorator
54
+ public static function makeJob (mixed ...$ arguments ): JobDecorator
56
55
{
57
56
if (static ::jobShouldBeUnique ()) {
58
57
return static ::makeUniqueJob (...$ arguments );
@@ -61,93 +60,52 @@ public static function makeJob(...$arguments): JobDecorator
61
60
return new ActionManager::$ jobDecorator (static ::class, ...$ arguments );
62
61
}
63
62
64
- /**
65
- * @param mixed ...$arguments
66
- * @return UniqueJobDecorator
67
- */
68
- public static function makeUniqueJob (...$ arguments ): UniqueJobDecorator
63
+ public static function makeUniqueJob (mixed ...$ arguments ): UniqueJobDecorator
69
64
{
70
65
return new ActionManager::$ uniqueJobDecorator (static ::class, ...$ arguments );
71
66
}
72
67
73
- /**
74
- * @return bool
75
- */
76
68
protected static function jobShouldBeUnique (): bool
77
69
{
78
70
return is_subclass_of (static ::class, ShouldBeUnique::class);
79
71
}
80
72
81
- /**
82
- * @param mixed ...$arguments
83
- * @return PendingDispatch
84
- */
85
- public static function dispatch (...$ arguments ): PendingDispatch
73
+ public static function dispatch (mixed ...$ arguments ): PendingDispatch
86
74
{
87
75
return new PendingDispatch (static ::makeJob (...$ arguments ));
88
76
}
89
77
90
- /**
91
- * @param $boolean
92
- * @param mixed ...$arguments
93
- * @return PendingDispatch|Fluent
94
- */
95
- public static function dispatchIf ($ boolean , ...$ arguments )
78
+ public static function dispatchIf (bool $ boolean , mixed ...$ arguments ): PendingDispatch |Fluent
96
79
{
97
80
return $ boolean ? static ::dispatch (...$ arguments ) : new Fluent ;
98
81
}
99
82
100
- /**
101
- * @param $boolean
102
- * @param mixed ...$arguments
103
- * @return PendingDispatch|Fluent
104
- */
105
- public static function dispatchUnless ($ boolean , ...$ arguments )
83
+ public static function dispatchUnless (bool $ boolean , mixed ...$ arguments ): PendingDispatch |Fluent
106
84
{
107
85
return static ::dispatchIf (! $ boolean , ...$ arguments );
108
86
}
109
87
110
- /**
111
- * @param mixed ...$arguments
112
- * @return mixed
113
- */
114
- public static function dispatchSync (...$ arguments )
88
+ public static function dispatchSync (mixed ...$ arguments ): mixed
115
89
{
116
90
return app (Dispatcher::class)->dispatchSync (static ::makeJob (...$ arguments ));
117
91
}
118
92
119
- /**
120
- * @param mixed ...$arguments
121
- * @return mixed
122
- */
123
- public static function dispatchNow (...$ arguments )
93
+ public static function dispatchNow (mixed ...$ arguments ): mixed
124
94
{
125
95
return static ::dispatchSync (...$ arguments );
126
96
}
127
97
128
- /**
129
- * @param mixed ...$arguments
130
- * @return void
131
- */
132
- public static function dispatchAfterResponse (...$ arguments ): void
98
+ public static function dispatchAfterResponse (mixed ...$ arguments ): void
133
99
{
134
100
static ::dispatch (...$ arguments )->afterResponse ();
135
101
}
136
102
137
- /**
138
- * @param $chain
139
- * @return ActionPendingChain
140
- */
141
- public static function withChain ($ chain ): ActionPendingChain
103
+ public static function withChain (array $ chain ): ActionPendingChain
142
104
{
143
105
return new ActionPendingChain (static ::class, $ chain );
144
106
}
145
107
146
- /**
147
- * @param Closure|int|null $times
148
- * @param Closure|null $callback
149
- */
150
- public static function assertPushed ($ times = null , Closure $ callback = null ): void
108
+ public static function assertPushed (Closure |int |null $ times = null , Closure |null $ callback = null ): void
151
109
{
152
110
if ($ times instanceof Closure) {
153
111
$ callback = $ times ;
@@ -191,20 +149,12 @@ public static function assertPushed($times = null, Closure $callback = null): vo
191
149
}
192
150
}
193
151
194
- /**
195
- * @param Closure|null $callback
196
- */
197
- public static function assertNotPushed (Closure $ callback = null ): void
152
+ public static function assertNotPushed (Closure |null $ callback = null ): void
198
153
{
199
154
static ::assertPushed (0 , $ callback );
200
155
}
201
156
202
- /**
203
- * @param string $queue
204
- * @param Closure|int|null $times
205
- * @param Closure|null $callback
206
- */
207
- public static function assertPushedOn (string $ queue , $ times = null , Closure $ callback = null ): void
157
+ public static function assertPushedOn (string $ queue , Closure |int |null $ times = null , Closure |null $ callback = null ): void
208
158
{
209
159
if ($ times instanceof Closure) {
210
160
$ callback = $ times ;
0 commit comments