Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit 7e4ea0e

Browse files
authored
Merge pull request #71 from Sammyjo20/fix/formatting
Fix | Added formatting
2 parents 45c41b0 + 5f5714a commit 7e4ea0e

34 files changed

+2
-386
lines changed

src/Builders/HaystackBuilder.php

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -29,71 +29,51 @@ class HaystackBuilder
2929

3030
/**
3131
* The name of the haystack.
32-
*
33-
* @var string|null
3432
*/
3533
protected ?string $name = null;
3634

3735
/**
3836
* The jobs to be added to the Haystack.
39-
*
40-
* @var Collection
4137
*/
4238
protected Collection $jobs;
4339

4440
/**
4541
* Global connection
46-
*
47-
* @var string|null
4842
*/
4943
public ?string $globalConnection = null;
5044

5145
/**
5246
* Global queue
53-
*
54-
* @var string|null
5547
*/
5648
public ?string $globalQueue = null;
5749

5850
/**
5951
* Global delay
60-
*
61-
* @var int
6252
*/
6353
public int $globalDelayInSeconds = 0;
6454

6555
/**
6656
* Callbacks that will be run at various events
67-
*
68-
* @var CallbackCollection
6957
*/
7058
protected CallbackCollection $callbacks;
7159

7260
/**
7361
* Middleware that will be applied to every job
74-
*
75-
* @var MiddlewareCollection
7662
*/
7763
protected MiddlewareCollection $middleware;
7864

7965
/**
8066
* Other Haystack Options
81-
*
82-
* @var HaystackOptions
8367
*/
8468
protected HaystackOptions $options;
8569

8670
/**
8771
* Array of pending data objects containing the initial data.
88-
*
89-
* @var Collection
9072
*/
9173
protected Collection $initialData;
9274

9375
/**
9476
* Closure to execute before saving
95-
*
96-
* @var Closure|null
9777
*/
9878
protected ?Closure $beforeSave = null;
9979

@@ -112,7 +92,6 @@ public function __construct()
11292
/**
11393
* Specify a name for the haystack.
11494
*
115-
* @param string $name
11695
* @return $this
11796
*/
11897
public function withName(string $name): static
@@ -125,7 +104,6 @@ public function withName(string $name): static
125104
/**
126105
* Provide a closure that will run when the haystack is complete.
127106
*
128-
* @param Closure|callable $closure
129107
* @return $this
130108
*
131109
* @throws PhpVersionNotSupportedException
@@ -140,7 +118,6 @@ public function then(Closure|callable $closure): static
140118
/**
141119
* Provide a closure that will run when the haystack fails.
142120
*
143-
* @param Closure|callable $closure
144121
* @return $this
145122
*
146123
* @throws PhpVersionNotSupportedException
@@ -155,7 +132,6 @@ public function catch(Closure|callable $closure): static
155132
/**
156133
* Provide a closure that will run when the haystack finishes.
157134
*
158-
* @param Closure|callable $closure
159135
* @return $this
160136
*
161137
* @throws PhpVersionNotSupportedException
@@ -170,7 +146,6 @@ public function finally(Closure|callable $closure): static
170146
/**
171147
* Provide a closure that will run when the haystack is paused.
172148
*
173-
* @param Closure|callable $closure
174149
* @return $this
175150
*
176151
* @throws PhpVersionNotSupportedException
@@ -185,10 +160,6 @@ public function paused(Closure|callable $closure): static
185160
/**
186161
* Add a job to the haystack.
187162
*
188-
* @param StackableJob $job
189-
* @param int $delayInSeconds
190-
* @param string|null $queue
191-
* @param string|null $connection
192163
* @return $this
193164
*/
194165
public function addJob(StackableJob $job, int $delayInSeconds = 0, string $queue = null, string $connection = null): static
@@ -203,8 +174,6 @@ public function addJob(StackableJob $job, int $delayInSeconds = 0, string $queue
203174
/**
204175
* Add a job when a condition is true.
205176
*
206-
* @param bool $condition
207-
* @param ...$arguments
208177
* @return $this
209178
*/
210179
public function addJobWhen(bool $condition, ...$arguments): static
@@ -215,8 +184,6 @@ public function addJobWhen(bool $condition, ...$arguments): static
215184
/**
216185
* Add a job when a condition is false.
217186
*
218-
* @param bool $condition
219-
* @param ...$arguments
220187
* @return $this
221188
*/
222189
public function addJobUnless(bool $condition, ...$arguments): static
@@ -227,10 +194,6 @@ public function addJobUnless(bool $condition, ...$arguments): static
227194
/**
228195
* Add multiple jobs to the haystack at a time.
229196
*
230-
* @param Collection|array $jobs
231-
* @param int $delayInSeconds
232-
* @param string|null $queue
233-
* @param string|null $connection
234197
* @return $this
235198
*/
236199
public function addJobs(Collection|array $jobs, int $delayInSeconds = 0, string $queue = null, string $connection = null): static
@@ -251,8 +214,6 @@ public function addJobs(Collection|array $jobs, int $delayInSeconds = 0, string
251214
/**
252215
* Add jobs when a condition is true.
253216
*
254-
* @param bool $condition
255-
* @param ...$arguments
256217
* @return $this
257218
*/
258219
public function addJobsWhen(bool $condition, ...$arguments): static
@@ -263,8 +224,6 @@ public function addJobsWhen(bool $condition, ...$arguments): static
263224
/**
264225
* Add jobs when a condition is false.
265226
*
266-
* @param bool $condition
267-
* @param ...$arguments
268227
* @return $this
269228
*/
270229
public function addJobsUnless(bool $condition, ...$arguments): static
@@ -277,10 +236,6 @@ public function addJobsUnless(bool $condition, ...$arguments): static
277236
*
278237
* @alias addJob()
279238
*
280-
* @param StackableJob $job
281-
* @param int $delayInSeconds
282-
* @param string|null $queue
283-
* @param string|null $connection
284239
* @return $this
285240
*/
286241
public function addBale(StackableJob $job, int $delayInSeconds = 0, string $queue = null, string $connection = null): static
@@ -293,10 +248,6 @@ public function addBale(StackableJob $job, int $delayInSeconds = 0, string $queu
293248
*
294249
* @alias addJobs()
295250
*
296-
* @param Collection|array $jobs
297-
* @param int $delayInSeconds
298-
* @param string|null $queue
299-
* @param string|null $connection
300251
* @return $this
301252
*/
302253
public function addBales(Collection|array $jobs, int $delayInSeconds = 0, string $queue = null, string $connection = null): static
@@ -307,7 +258,6 @@ public function addBales(Collection|array $jobs, int $delayInSeconds = 0, string
307258
/**
308259
* Set a global delay on the jobs.
309260
*
310-
* @param int $seconds
311261
* @return $this
312262
*/
313263
public function withDelay(int $seconds): static
@@ -320,7 +270,6 @@ public function withDelay(int $seconds): static
320270
/**
321271
* Set a global queue for the jobs.
322272
*
323-
* @param string $queue
324273
* @return $this
325274
*/
326275
public function onQueue(string $queue): static
@@ -333,7 +282,6 @@ public function onQueue(string $queue): static
333282
/**
334283
* Set a global connection for the jobs.
335284
*
336-
* @param string $connection
337285
* @return $this
338286
*/
339287
public function onConnection(string $connection): static
@@ -346,7 +294,6 @@ public function onConnection(string $connection): static
346294
/**
347295
* Add some middleware to be merged in with every job
348296
*
349-
* @param Closure|callable|array $value
350297
* @return $this
351298
*
352299
* @throws PhpVersionNotSupportedException
@@ -361,9 +308,6 @@ public function addMiddleware(Closure|callable|array $value): static
361308
/**
362309
* Provide data before the haystack is created.
363310
*
364-
* @param string $key
365-
* @param mixed $value
366-
* @param string|null $cast
367311
* @return $this
368312
*/
369313
public function withData(string $key, mixed $value, string $cast = null): static
@@ -378,8 +322,6 @@ public function withData(string $key, mixed $value, string $cast = null): static
378322
/**
379323
* Store a model to be shared across all haystack jobs.
380324
*
381-
* @param Model $model
382-
* @param string|null $key
383325
* @return $this
384326
*
385327
* @throws HaystackModelExists
@@ -399,8 +341,6 @@ public function withModel(Model $model, string $key = null): static
399341

400342
/**
401343
* Create the Haystack
402-
*
403-
* @return Haystack
404344
*/
405345
public function create(): Haystack
406346
{
@@ -409,8 +349,6 @@ public function create(): Haystack
409349

410350
/**
411351
* Dispatch the Haystack.
412-
*
413-
* @return Haystack
414352
*/
415353
public function dispatch(): Haystack
416354
{
@@ -423,9 +361,6 @@ public function dispatch(): Haystack
423361

424362
/**
425363
* Map the jobs to be ready for inserting.
426-
*
427-
* @param Haystack $haystack
428-
* @return array
429364
*/
430365
protected function prepareJobsForInsert(Haystack $haystack): array
431366
{
@@ -457,9 +392,6 @@ protected function prepareJobsForInsert(Haystack $haystack): array
457392

458393
/**
459394
* Map the initial data to be ready for inserting.
460-
*
461-
* @param Haystack $haystack
462-
* @return array
463395
*/
464396
protected function prepareDataForInsert(Haystack $haystack): array
465397
{
@@ -477,8 +409,6 @@ protected function prepareDataForInsert(Haystack $haystack): array
477409

478410
/**
479411
* Create the haystack.
480-
*
481-
* @return Haystack
482412
*/
483413
protected function createHaystack(): Haystack
484414
{
@@ -533,8 +463,6 @@ public function allowFailures(): static
533463

534464
/**
535465
* Get all the jobs in the builder.
536-
*
537-
* @return Collection
538466
*/
539467
public function getJobs(): Collection
540468
{
@@ -543,8 +471,6 @@ public function getJobs(): Collection
543471

544472
/**
545473
* Retrieve the callbacks
546-
*
547-
* @return CallbackCollection
548474
*/
549475
public function getCallbacks(): CallbackCollection
550476
{
@@ -553,8 +479,6 @@ public function getCallbacks(): CallbackCollection
553479

554480
/**
555481
* Get the time for the "withDelay".
556-
*
557-
* @return int
558482
*/
559483
public function getGlobalDelayInSeconds(): int
560484
{
@@ -563,8 +487,6 @@ public function getGlobalDelayInSeconds(): int
563487

564488
/**
565489
* Get the global queue
566-
*
567-
* @return string|null
568490
*/
569491
public function getGlobalQueue(): ?string
570492
{
@@ -573,8 +495,6 @@ public function getGlobalQueue(): ?string
573495

574496
/**
575497
* Get the global connection.
576-
*
577-
* @return string|null
578498
*/
579499
public function getGlobalConnection(): ?string
580500
{
@@ -583,8 +503,6 @@ public function getGlobalConnection(): ?string
583503

584504
/**
585505
* Get the closure for the global middleware.
586-
*
587-
* @return MiddlewareCollection
588506
*/
589507
public function getMiddleware(): MiddlewareCollection
590508
{
@@ -594,7 +512,6 @@ public function getMiddleware(): MiddlewareCollection
594512
/**
595513
* Specify a closure to run before saving the Haystack
596514
*
597-
* @param Closure $closure
598515
* @return $this
599516
*/
600517
public function beforeSave(Closure $closure): static
@@ -607,8 +524,6 @@ public function beforeSave(Closure $closure): static
607524
/**
608525
* Set an option on the Haystack Options.
609526
*
610-
* @param string $option
611-
* @param mixed $value
612527
* @return $this
613528
*/
614529
public function setOption(string $option, mixed $value): static

src/Casts/CallbackCollectionCast.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ class CallbackCollectionCast implements CastsAttributes
1313
/**
1414
* Unserialize a job.
1515
*
16-
* @param $model
17-
* @param string $key
18-
* @param $value
19-
* @param array $attributes
2016
* @return mixed|null
2117
*/
2218
public function get($model, string $key, $value, array $attributes)
@@ -27,10 +23,6 @@ public function get($model, string $key, $value, array $attributes)
2723
/**
2824
* Serialize a job.
2925
*
30-
* @param $model
31-
* @param string $key
32-
* @param $value
33-
* @param array $attributes
3426
* @return mixed|string|null
3527
*/
3628
public function set($model, string $key, $value, array $attributes)

0 commit comments

Comments
 (0)