REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 3.72 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Bus/ChainedBatch.php
Text
Base64
<?php namespace Illuminate\Bus; use Illuminate\Container\Container; use Illuminate\Contracts\Bus\Dispatcher; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Support\Collection; use Throwable; class ChainedBatch implements ShouldQueue { use Batchable, Dispatchable, InteractsWithQueue, Queueable; /** * The collection of batched jobs. * * @var \Illuminate\Support\Collection */ public Collection $jobs; /** * The name of the batch. * * @var string */ public string $name; /** * The batch options. * * @var array */ public array $options; /** * Create a new chained batch instance. * * @param \Illuminate\Bus\PendingBatch $batch * @return void */ public function __construct(PendingBatch $batch) { $this->jobs = static::prepareNestedBatches($batch->jobs); $this->name = $batch->name; $this->options = $batch->options; } /** * Prepare any nested batches within the given collection of jobs. * * @param \Illuminate\Support\Collection $jobs * @return \Illuminate\Support\Collection */ public static function prepareNestedBatches(Collection $jobs): Collection { return $jobs->map(fn ($job) => match (true) { is_array($job) => static::prepareNestedBatches(new Collection($job))->all(), $job instanceof Collection => static::prepareNestedBatches($job), $job instanceof PendingBatch => new ChainedBatch($job), default => $job, }); } /** * Handle the job. * * @return void */ public function handle() { $this->attachRemainderOfChainToEndOfBatch( $this->toPendingBatch() )->dispatch(); } /** * Convert the chained batch instance into a pending batch. * * @return \Illuminate\Bus\PendingBatch */ public function toPendingBatch() { $batch = Container::getInstance()->make(Dispatcher::class)->batch($this->jobs); $batch->name = $this->name; $batch->options = $this->options; if ($this->queue) { $batch->onQueue($this->queue); } if ($this->connection) { $batch->onConnection($this->connection); } foreach ($this->chainCatchCallbacks ?? [] as $callback) { $batch->catch(function (Batch $batch, ?Throwable $exception) use ($callback) { if (! $batch->allowsFailures()) { $callback($exception); } }); } return $batch; } /** * Move the remainder of the chain to a "finally" batch callback. * * @param \Illuminate\Bus\PendingBatch $batch * @return \Illuminate\Bus\PendingBatch */ protected function attachRemainderOfChainToEndOfBatch(PendingBatch $batch) { if (! empty($this->chained)) { $next = unserialize(array_shift($this->chained)); $next->chained = $this->chained; $next->onConnection($next->connection ?: $this->chainConnection); $next->onQueue($next->queue ?: $this->chainQueue); $next->chainConnection = $this->chainConnection; $next->chainQueue = $this->chainQueue; $next->chainCatchCallbacks = $this->chainCatchCallbacks; $batch->finally(function (Batch $batch) use ($next) { if (! $batch->cancelled()) { Container::getInstance()->make(Dispatcher::class)->dispatch($next); } }); $this->chained = []; } return $batch; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 16
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Events
DIR
-
drwxrwxrwx
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Batch.php
12.46 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Batchable.php
2.76 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BatchFactory.php
1.71 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BatchRepository.php
2.26 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BusServiceProvider.php
3.33 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ChainedBatch.php
3.72 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
composer.json
998 B
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DatabaseBatchRepository.php
10.79 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Dispatcher.php
7.46 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DynamoBatchRepository.php
14.94 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE.md
1.05 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PendingBatch.php
9.29 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PrunableBatchRepository.php
318 B
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Queueable.php
7.72 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UniqueLock.php
1.69 KB
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UpdatedBatchJobCounts.php
856 B
lrw-rw-rw-
2025-09-17 06:53:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).