Skip to content

Commit 1cd1d47

Browse files
committed
Merge tag 'v12.32.5'
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
2 parents d210da3 + 77b2740 commit 1cd1d47

File tree

257 files changed

+7461
-2669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+7461
-2669
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
ports:
2020
- 11211:11211
2121
mysql:
22-
image: mysql:5.7
22+
image: mysql:8
2323
env:
2424
MYSQL_ALLOW_EMPTY_PASSWORD: yes
2525
MYSQL_DATABASE: forge
@@ -72,6 +72,15 @@ jobs:
7272
- name: Set Framework version
7373
run: composer config version "13.x-dev"
7474

75+
- name: Set Minimum dependencies for `prefer-lowest`
76+
uses: nick-fields/retry@v3
77+
with:
78+
timeout_minutes: 5
79+
max_attempts: 5
80+
command: composer require opis/string:2.0.1 --no-interaction --no-update
81+
shell: bash
82+
if: matrix.stability == 'prefer-lowest'
83+
7584
- name: Install dependencies
7685
uses: nick-fields/retry@v3
7786
with:
@@ -136,6 +145,15 @@ jobs:
136145
- name: Set Framework version
137146
run: composer config version "13.x-dev"
138147

148+
- name: Set Minimum dependencies for `prefer-lowest`
149+
uses: nick-fields/retry@v3
150+
with:
151+
timeout_minutes: 5
152+
max_attempts: 5
153+
command: composer require opis/string:2.0.1 --no-interaction --no-update
154+
shell: bash
155+
if: matrix.stability == 'prefer-lowest'
156+
139157
- name: Install dependencies
140158
uses: nick-fields/retry@v3
141159
with:

.github/workflows/update-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- uses: actions/setup-node@v4
2323
with:
24-
node-version: 18
24+
node-version: 22
2525

2626
- name: Update Exception Renderer Assets
2727
run: |

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
.DS_Store
2+
.phpunit.result.cache
3+
/.fleet
4+
/.idea
15
/.phpunit.cache
6+
/phpunit.xml
7+
/.vscode
28
/vendor
39
composer.phar
410
composer.lock
5-
.DS_Store
611
Thumbs.db
7-
/phpunit.xml
8-
/.idea
9-
/.fleet
10-
/.vscode
11-
.phpunit.result.cache

CHANGELOG.md

Lines changed: 147 additions & 1 deletion
Large diffs are not rendered by default.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
181181
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).",
182182
"brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).",
183-
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
183+
"fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).",
184184
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
185185
"laravel/tinker": "Required to use the tinker console command (^2.0).",
186186
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).",

config/cache.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
'serialize' => false,
3939
],
4040

41+
'session' => [
42+
'driver' => 'session',
43+
'key' => env('SESSION_CACHE_KEY', '_cache'),
44+
],
45+
4146
'database' => [
4247
'driver' => 'database',
4348
'connection' => env('DB_CACHE_CONNECTION'),

config/database.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'journal_mode' => null,
4343
'synchronous' => null,
4444
'transaction_mode' => 'DEFERRED',
45+
'pragmas' => [],
4546
],
4647

4748
'mysql' => [

src/Illuminate/Auth/Access/Gate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ protected function authorizeOnDemand($condition, $message, $code, $allowWhenResp
186186
$response = $condition;
187187
}
188188

189-
return with($response instanceof Response ? $response : new Response(
189+
return ($response instanceof Response ? $response : new Response(
190190
(bool) $response === $allowWhenResponseIs, $message, $code
191191
))->authorize();
192192
}

src/Illuminate/Broadcasting/BroadcastEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function middleware(): array
196196
/**
197197
* Handle a job failure.
198198
*
199-
* @param \Throwable $e
199+
* @param \Throwable|null $e
200200
* @return void
201201
*/
202202
public function failed(?Throwable $e = null): void

src/Illuminate/Bus/Batch.php

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ public function add($jobs)
168168
if (is_array($job)) {
169169
$count += count($job);
170170

171-
return with($this->prepareBatchedChain($job), function ($chain) {
172-
return $chain->first()
173-
->allOnQueue($this->options['queue'] ?? null)
174-
->allOnConnection($this->options['connection'] ?? null)
175-
->chain($chain->slice(1)->values()->all());
176-
});
171+
$chain = $this->prepareBatchedChain($job);
172+
173+
return $chain->first()
174+
->allOnQueue($this->options['queue'] ?? null)
175+
->allOnConnection($this->options['connection'] ?? null)
176+
->chain($chain->slice(1)->values()->all());
177177
} else {
178178
$job->withBatchId($this->id);
179179

@@ -242,31 +242,19 @@ public function recordSuccessfulJob(string $jobId)
242242
$counts = $this->decrementPendingJobs($jobId);
243243

244244
if ($this->hasProgressCallbacks()) {
245-
$batch = $this->fresh();
246-
247-
(new Collection($this->options['progress']))->each(function ($handler) use ($batch) {
248-
$this->invokeHandlerCallback($handler, $batch);
249-
});
245+
$this->invokeCallbacks('progress');
250246
}
251247

252248
if ($counts->pendingJobs === 0) {
253249
$this->repository->markAsFinished($this->id);
254250
}
255251

256252
if ($counts->pendingJobs === 0 && $this->hasThenCallbacks()) {
257-
$batch = $this->fresh();
258-
259-
(new Collection($this->options['then']))->each(function ($handler) use ($batch) {
260-
$this->invokeHandlerCallback($handler, $batch);
261-
});
253+
$this->invokeCallbacks('then');
262254
}
263255

264256
if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) {
265-
$batch = $this->fresh();
266-
267-
(new Collection($this->options['finally']))->each(function ($handler) use ($batch) {
268-
$this->invokeHandlerCallback($handler, $batch);
269-
});
257+
$this->invokeCallbacks('finally');
270258
}
271259
}
272260

@@ -281,6 +269,18 @@ public function decrementPendingJobs(string $jobId)
281269
return $this->repository->decrementPendingJobs($this->id, $jobId);
282270
}
283271

272+
/**
273+
* Invoke the callbacks of the given type.
274+
*/
275+
protected function invokeCallbacks(string $type, ?Throwable $e = null): void
276+
{
277+
$batch = $this->fresh();
278+
279+
foreach ($this->options[$type] ?? [] as $handler) {
280+
$this->invokeHandlerCallback($handler, $batch, $e);
281+
}
282+
}
283+
284284
/**
285285
* Determine if the batch has finished executing.
286286
*
@@ -346,28 +346,22 @@ public function recordFailedJob(string $jobId, $e)
346346
$this->cancel();
347347
}
348348

349-
if ($this->hasProgressCallbacks() && $this->allowsFailures()) {
350-
$batch = $this->fresh();
349+
if ($this->allowsFailures()) {
350+
if ($this->hasProgressCallbacks()) {
351+
$this->invokeCallbacks('progress', $e);
352+
}
351353

352-
(new Collection($this->options['progress']))->each(function ($handler) use ($batch, $e) {
353-
$this->invokeHandlerCallback($handler, $batch, $e);
354-
});
354+
if ($this->hasFailureCallbacks()) {
355+
$this->invokeCallbacks('failure', $e);
356+
}
355357
}
356358

357359
if ($counts->failedJobs === 1 && $this->hasCatchCallbacks()) {
358-
$batch = $this->fresh();
359-
360-
(new Collection($this->options['catch']))->each(function ($handler) use ($batch, $e) {
361-
$this->invokeHandlerCallback($handler, $batch, $e);
362-
});
360+
$this->invokeCallbacks('catch', $e);
363361
}
364362

365363
if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) {
366-
$batch = $this->fresh();
367-
368-
(new Collection($this->options['finally']))->each(function ($handler) use ($batch, $e) {
369-
$this->invokeHandlerCallback($handler, $batch, $e);
370-
});
364+
$this->invokeCallbacks('finally');
371365
}
372366
}
373367

@@ -392,6 +386,14 @@ public function hasCatchCallbacks()
392386
return isset($this->options['catch']) && ! empty($this->options['catch']);
393387
}
394388

389+
/**
390+
* Determine if the batch has "failure" callbacks.
391+
*/
392+
public function hasFailureCallbacks(): bool
393+
{
394+
return isset($this->options['failure']) && ! empty($this->options['failure']);
395+
}
396+
395397
/**
396398
* Determine if the batch has "finally" callbacks.
397399
*

0 commit comments

Comments
 (0)