Skip to content

Commit 042ed1e

Browse files
committed
Merge branch '9.x'
# Conflicts: # .github/workflows/tests.yml # CHANGELOG.md # src/Illuminate/Foundation/Application.php
2 parents f2b3092 + 2641bc1 commit 042ed1e

File tree

156 files changed

+3354
-486
lines changed

Some content is hidden

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

156 files changed

+3354
-486
lines changed

.github/workflows/databases.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout code
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3232

3333
- name: Setup PHP
3434
uses: shivammathur/setup-php@v2
@@ -39,7 +39,7 @@ jobs:
3939
coverage: none
4040

4141
- name: Install dependencies
42-
uses: nick-invision/retry@v1
42+
uses: nick-fields/retry@v2
4343
with:
4444
timeout_minutes: 5
4545
max_attempts: 5
@@ -71,7 +71,7 @@ jobs:
7171

7272
steps:
7373
- name: Checkout code
74-
uses: actions/checkout@v2
74+
uses: actions/checkout@v3
7575

7676
- name: Setup PHP
7777
uses: shivammathur/setup-php@v2
@@ -82,7 +82,7 @@ jobs:
8282
coverage: none
8383

8484
- name: Install dependencies
85-
uses: nick-invision/retry@v1
85+
uses: nick-fields/retry@v2
8686
with:
8787
timeout_minutes: 5
8888
max_attempts: 5
@@ -114,7 +114,7 @@ jobs:
114114

115115
steps:
116116
- name: Checkout code
117-
uses: actions/checkout@v2
117+
uses: actions/checkout@v3
118118

119119
- name: Setup PHP
120120
uses: shivammathur/setup-php@v2
@@ -125,7 +125,7 @@ jobs:
125125
coverage: none
126126

127127
- name: Install dependencies
128-
uses: nick-invision/retry@v1
128+
uses: nick-fields/retry@v2
129129
with:
130130
timeout_minutes: 5
131131
max_attempts: 5
@@ -158,7 +158,7 @@ jobs:
158158

159159
steps:
160160
- name: Checkout code
161-
uses: actions/checkout@v2
161+
uses: actions/checkout@v3
162162

163163
- name: Setup PHP
164164
uses: shivammathur/setup-php@v2
@@ -169,7 +169,7 @@ jobs:
169169
coverage: none
170170

171171
- name: Install dependencies
172-
uses: nick-invision/retry@v1
172+
uses: nick-fields/retry@v2
173173
with:
174174
timeout_minutes: 5
175175
max_attempts: 5
@@ -200,7 +200,7 @@ jobs:
200200

201201
steps:
202202
- name: Checkout code
203-
uses: actions/checkout@v2
203+
uses: actions/checkout@v3
204204

205205
- name: Setup PHP
206206
uses: shivammathur/setup-php@v2
@@ -211,7 +211,7 @@ jobs:
211211
coverage: none
212212

213213
- name: Install dependencies
214-
uses: nick-invision/retry@v1
214+
uses: nick-fields/retry@v2
215215
with:
216216
timeout_minutes: 5
217217
max_attempts: 5

.github/workflows/issues.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: issues
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
help-wanted:
12+
uses: laravel/.github/.github/workflows/issues.yml@main

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2424

2525
- name: Setup PHP
2626
uses: shivammathur/setup-php@v2
@@ -30,7 +30,7 @@ jobs:
3030
coverage: none
3131

3232
- name: Install dependencies
33-
uses: nick-invision/retry@v1
33+
uses: nick-fields/retry@v2
3434
with:
3535
timeout_minutes: 5
3636
max_attempts: 5

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
steps:
4848
- name: Checkout code
49-
uses: actions/checkout@v2
49+
uses: actions/checkout@v3
5050

5151
- name: Setup PHP
5252
uses: shivammathur/setup-php@v2
@@ -61,23 +61,23 @@ jobs:
6161
REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev
6262

6363
- name: Set Minimum PHP 8.1 Versions
64-
uses: nick-invision/retry@v1
64+
uses: nick-fields/retry@v2
6565
with:
6666
timeout_minutes: 5
6767
max_attempts: 5
6868
command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update
6969
if: matrix.php >= 8.1
7070

7171
- name: Set Minimum PHP 8.2 Versions
72-
uses: nick-invision/retry@v1
72+
uses: nick-fields/retry@v2
7373
with:
7474
timeout_minutes: 5
7575
max_attempts: 5
7676
command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update
7777
if: matrix.php >= 8.2
7878

7979
- name: Install dependencies
80-
uses: nick-invision/retry@v1
80+
uses: nick-fields/retry@v2
8181
with:
8282
timeout_minutes: 5
8383
max_attempts: 5
@@ -119,7 +119,7 @@ jobs:
119119
git config --global core.eol lf
120120
121121
- name: Checkout code
122-
uses: actions/checkout@v2
122+
uses: actions/checkout@v3
123123

124124
- name: Setup PHP
125125
uses: shivammathur/setup-php@v2
@@ -130,23 +130,23 @@ jobs:
130130
coverage: none
131131

132132
- name: Set Minimum PHP 8.1 Versions
133-
uses: nick-invision/retry@v1
133+
uses: nick-fields/retry@v2
134134
with:
135135
timeout_minutes: 5
136136
max_attempts: 5
137137
command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update
138138
if: matrix.php >= 8.1
139139

140140
- name: Set Minimum PHP 8.2 Versions
141-
uses: nick-invision/retry@v1
141+
uses: nick-fields/retry@v2
142142
with:
143143
timeout_minutes: 5
144144
max_attempts: 5
145145
command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update
146146
if: matrix.php >= 8.2
147147

148148
- name: Install dependencies
149-
uses: nick-invision/retry@v1
149+
uses: nick-fields/retry@v2
150150
with:
151151
timeout_minutes: 5
152152
max_attempts: 5

src/Illuminate/Broadcasting/BroadcastManager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ protected function resolve($name)
245245
{
246246
$config = $this->getConfig($name);
247247

248+
if (is_null($config)) {
249+
throw new InvalidArgumentException("Broadcast connection [{$name}] is not defined.");
250+
}
251+
248252
if (isset($this->customCreators[$config['driver']])) {
249253
return $this->callCustomCreator($config);
250254
}

src/Illuminate/Bus/BusServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function provides()
6464
DispatcherContract::class,
6565
QueueingDispatcherContract::class,
6666
BatchRepository::class,
67+
DatabaseBatchRepository::class,
6768
];
6869
}
6970
}

src/Illuminate/Bus/DatabaseBatchRepository.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,29 @@ public function pruneUnfinished(DateTimeInterface $before)
277277
return $totalDeleted;
278278
}
279279

280+
/**
281+
* Prune all of the cancelled entries older than the given date.
282+
*
283+
* @param \DateTimeInterface $before
284+
* @return int
285+
*/
286+
public function pruneCancelled(DateTimeInterface $before)
287+
{
288+
$query = $this->connection->table($this->table)
289+
->whereNotNull('cancelled_at')
290+
->where('created_at', '<', $before->getTimestamp());
291+
292+
$totalDeleted = 0;
293+
294+
do {
295+
$deleted = $query->take(1000)->delete();
296+
297+
$totalDeleted += $deleted;
298+
} while ($deleted !== 0);
299+
300+
return $totalDeleted;
301+
}
302+
280303
/**
281304
* Execute the given Closure within a storage specific transaction.
282305
*

src/Illuminate/Collections/Collection.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,26 @@ public function contains($key, $operator = null, $value = null)
183183
return $this->contains($this->operatorForWhere(...func_get_args()));
184184
}
185185

186+
/**
187+
* Determine if an item exists, using strict comparison.
188+
*
189+
* @param (callable(TValue): bool)|TValue|array-key $key
190+
* @param TValue|null $value
191+
* @return bool
192+
*/
193+
public function containsStrict($key, $value = null)
194+
{
195+
if (func_num_args() === 2) {
196+
return $this->contains(fn ($item) => data_get($item, $key) === $value);
197+
}
198+
199+
if ($this->useAsCallable($key)) {
200+
return ! is_null($this->first($key));
201+
}
202+
203+
return in_array($key, $this->items, true);
204+
}
205+
186206
/**
187207
* Determine if an item is not contained in the collection.
188208
*
@@ -807,7 +827,7 @@ public function mergeRecursive($items)
807827
* @template TCombineValue
808828
*
809829
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
810-
* @return static<TKey, TCombineValue>
830+
* @return static<TValue, TCombineValue>
811831
*/
812832
public function combine($values)
813833
{

src/Illuminate/Collections/Enumerable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ public function mergeRecursive($items);
719719
* @template TCombineValue
720720
*
721721
* @param \Illuminate\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
722-
* @return static<TKey, TCombineValue>
722+
* @return static<TValue, TCombineValue>
723723
*/
724724
public function combine($values);
725725

@@ -1168,7 +1168,7 @@ public function count(): int;
11681168
* @param (callable(TValue, TKey): mixed)|string|null $countBy
11691169
* @return static<array-key, int>
11701170
*/
1171-
public function countBy($callback = null);
1171+
public function countBy($countBy = null);
11721172

11731173
/**
11741174
* Zip the collection together with one or more arrays.

src/Illuminate/Collections/LazyCollection.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,32 @@ public function contains($key, $operator = null, $value = null)
236236
return $this->contains($this->operatorForWhere(...func_get_args()));
237237
}
238238

239+
/**
240+
* Determine if an item exists, using strict comparison.
241+
*
242+
* @param (callable(TValue): bool)|TValue|array-key $key
243+
* @param TValue|null $value
244+
* @return bool
245+
*/
246+
public function containsStrict($key, $value = null)
247+
{
248+
if (func_num_args() === 2) {
249+
return $this->contains(fn ($item) => data_get($item, $key) === $value);
250+
}
251+
252+
if ($this->useAsCallable($key)) {
253+
return ! is_null($this->first($key));
254+
}
255+
256+
foreach ($this as $item) {
257+
if ($item === $key) {
258+
return true;
259+
}
260+
}
261+
262+
return false;
263+
}
264+
239265
/**
240266
* Determine if an item is not contained in the enumerable.
241267
*
@@ -798,7 +824,7 @@ public function mergeRecursive($items)
798824
* @template TCombineValue
799825
*
800826
* @param \IteratorAggregate<array-key, TCombineValue>|array<array-key, TCombineValue>|(callable(): \Generator<array-key, TCombineValue>) $values
801-
* @return static<TKey, TCombineValue>
827+
* @return static<TValue, TCombineValue>
802828
*/
803829
public function combine($values)
804830
{

0 commit comments

Comments
 (0)