Skip to content

Commit 8ac8d08

Browse files
Merge branch '8.x' into master
2 parents dc2721a + d3489bd commit 8ac8d08

File tree

20 files changed

+248
-50
lines changed

20 files changed

+248
-50
lines changed

CHANGELOG-6.x.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Release Notes for 6.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v6.18.37...6.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v6.18.38...6.x)
4+
5+
6+
## [v6.18.38 (2020-09-01)](https://github.com/laravel/framework/compare/v6.18.37...v6.18.38)
7+
8+
### Changed
9+
- Changed postgres processor ([#34055](https://github.com/laravel/framework/pull/34055))
410

511

612
## [v6.18.37 (2020-08-27)](https://github.com/laravel/framework/compare/v6.18.36...v6.18.37)

CHANGELOG-7.x.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Release Notes for 7.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v7.26.1...7.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v7.27.0...7.x)
4+
5+
6+
## [v7.27.0 (2020-09-01)](https://github.com/laravel/framework/compare/v7.26.1...v7.27.0)
7+
8+
### Added
9+
- Allow to use alias of morphed model ([#34032](https://github.com/laravel/framework/pull/34032))
10+
- Introduced basic padding (both, left, right) methods to Str and Stringable ([#34053](https://github.com/laravel/framework/pull/34053))
11+
12+
### Refactoring
13+
- RefreshDatabase migration commands parameters moved to methods ([#34007](https://github.com/laravel/framework/pull/34007), [8b35c8e](https://github.com/laravel/framework/commit/8b35c8e6ba5879e71fd81fd03b5687ee2b46c55a), [256f71c](https://github.com/laravel/framework/commit/256f71c1f81da2d4bb3e327b18389ac43fa97a72))
14+
15+
### Changed
16+
- allow to reset forced scheme and root-url in UrlGenerator ([#34039](https://github.com/laravel/framework/pull/34039))
17+
- Updating the make commands to use a custom views path ([#34060](https://github.com/laravel/framework/pull/34060), [b593c62](https://github.com/laravel/framework/commit/b593c6242942623fcc12638d0390da7c58dbbb11))
18+
- Using "public static property" in View Component causes an error ([#34058](https://github.com/laravel/framework/pull/34058))
19+
- Changed postgres processor ([#34055](https://github.com/laravel/framework/pull/34055))
420

521

622
## [v7.26.1 (2020-08-27)](https://github.com/laravel/framework/compare/v7.26.0...v7.26.1)

bin/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ then
1010
exit 1
1111
fi
1212

13-
RELEASE_BRANCH="master"
13+
RELEASE_BRANCH="8.x"
1414
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
1515
VERSION=$1
1616

bin/split.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44
set -x
55

6-
CURRENT_BRANCH="master"
6+
CURRENT_BRANCH="8.x"
77

88
function split()
99
{

src/Illuminate/Bus/Batch.php

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
use Carbon\CarbonImmutable;
66
use Illuminate\Contracts\Queue\Factory as QueueFactory;
77
use Illuminate\Contracts\Support\Arrayable;
8+
use Illuminate\Queue\SerializableClosure;
89
use Illuminate\Support\Arr;
910
use Illuminate\Support\Collection;
1011
use JsonSerializable;
12+
use Throwable;
1113

1214
class Batch implements Arrayable, JsonSerializable
1315
{
@@ -211,13 +213,17 @@ public function recordSuccessfulJob(string $jobId)
211213
if ($counts->pendingJobs === 0 && $this->hasThenCallbacks()) {
212214
$batch = $this->fresh();
213215

214-
collect($this->options['then'])->each->__invoke($batch);
216+
collect($this->options['then'])->each(function ($handler) use ($batch) {
217+
$this->invokeHandlerCallback($handler, $batch);
218+
});
215219
}
216220

217221
if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) {
218222
$batch = $this->fresh();
219223

220-
collect($this->options['finally'])->each->__invoke($batch);
224+
collect($this->options['finally'])->each(function ($handler) use ($batch) {
225+
$this->invokeHandlerCallback($handler, $batch);
226+
});
221227
}
222228
}
223229

@@ -290,13 +296,17 @@ public function recordFailedJob(string $jobId, $e)
290296
if ($counts->failedJobs === 1 && $this->hasCatchCallbacks()) {
291297
$batch = $this->fresh();
292298

293-
collect($this->options['catch'])->each->__invoke($batch, $e);
299+
collect($this->options['catch'])->each(function ($handler) use ($batch, $e) {
300+
$this->invokeHandlerCallback($handler, $batch, $e);
301+
});
294302
}
295303

296304
if ($counts->allJobsHaveRanExactlyOnce() && $this->hasFinallyCallbacks()) {
297305
$batch = $this->fresh();
298306

299-
collect($this->options['finally'])->each->__invoke($batch, $e);
307+
collect($this->options['finally'])->each(function ($handler) use ($batch, $e) {
308+
$this->invokeHandlerCallback($handler, $batch, $e);
309+
});
300310
}
301311
}
302312

@@ -371,6 +381,21 @@ public function delete()
371381
$this->repository->delete($this->id);
372382
}
373383

384+
/**
385+
* Invoke a batch callback handler.
386+
*
387+
* @param \Illuminate\Queue\SerializableClosure|callable $handler
388+
* @param \Illuminate\Bus $batch
389+
* @param \Throwable|null $e
390+
* @return void
391+
*/
392+
protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null)
393+
{
394+
return $handler instanceof SerializableClosure
395+
? $handler->__invoke($batch, $e)
396+
: call_user_func($handler, $batch, $e);
397+
}
398+
374399
/**
375400
* Convert the batch to an array.
376401
*

src/Illuminate/Bus/PendingBatch.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ public function __construct(Container $container, Collection $jobs)
5757
/**
5858
* Add a callback to be executed after all jobs in the batch have executed successfully.
5959
*
60-
* @param \Closure $callback
60+
* @param callable $callback
6161
* @return $this
6262
*/
63-
public function then(Closure $callback)
63+
public function then($callback)
6464
{
65-
$this->options['then'][] = new SerializableClosure($callback);
65+
$this->options['then'][] = $callback instanceof Closure
66+
? new SerializableClosure($callback)
67+
: $callback;
6668

6769
return $this;
6870
}
@@ -80,12 +82,14 @@ public function thenCallbacks()
8082
/**
8183
* Add a callback to be executed after the first failing job in the batch.
8284
*
83-
* @param \Closure $callback
85+
* @param callable $callback
8486
* @return $this
8587
*/
86-
public function catch(Closure $callback)
88+
public function catch($callback)
8789
{
88-
$this->options['catch'][] = new SerializableClosure($callback);
90+
$this->options['catch'][] = $callback instanceof Closure
91+
? new SerializableClosure($callback)
92+
: $callback;
8993

9094
return $this;
9195
}
@@ -103,12 +107,14 @@ public function catchCallbacks()
103107
/**
104108
* Add a callback to be executed after the batch has finished executing.
105109
*
106-
* @param \Closure $callback
110+
* @param callable $callback
107111
* @return $this
108112
*/
109-
public function finally(Closure $callback)
113+
public function finally($callback)
110114
{
111-
$this->options['finally'][] = new SerializableClosure($callback);
115+
$this->options['finally'][] = $callback instanceof Closure
116+
? new SerializableClosure($callback)
117+
: $callback;
112118

113119
return $this;
114120
}

src/Illuminate/Bus/Queueable.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Closure;
66
use Illuminate\Queue\CallQueuedClosure;
7+
use Illuminate\Queue\SerializableClosure;
78
use Illuminate\Support\Arr;
89
use RuntimeException;
910

@@ -210,6 +211,8 @@ public function dispatchNextJobInChain()
210211
*/
211212
public function invokeChainCatchCallbacks($e)
212213
{
213-
collect($this->chainCatchCallbacks)->each->__invoke($e);
214+
collect($this->chainCatchCallbacks)->each(function ($callback) use ($e) {
215+
$callback instanceof SerializableClosure ? $callback->__invoke($e) : call_user_func($callback, $e);
216+
});
214217
}
215218
}

src/Illuminate/Collections/Enumerable.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ public function avg($callback = null);
118118
*/
119119
public function contains($key, $operator = null, $value = null);
120120

121+
/**
122+
* Cross join with the given lists, returning all possible permutations.
123+
*
124+
* @param mixed ...$lists
125+
* @return static
126+
*/
127+
public function crossJoin(...$lists);
128+
121129
/**
122130
* Dump the collection and end the script.
123131
*
@@ -309,6 +317,22 @@ public function unlessNotEmpty(callable $callback, callable $default = null);
309317
*/
310318
public function where($key, $operator = null, $value = null);
311319

320+
/**
321+
* Filter items where the value for the given key is null.
322+
*
323+
* @param string|null $key
324+
* @return static
325+
*/
326+
public function whereNull($key = null);
327+
328+
/**
329+
* Filter items where the value for the given key is not null.
330+
*
331+
* @param string|null $key
332+
* @return static
333+
*/
334+
public function whereNotNull($key = null);
335+
312336
/**
313337
* Filter items by the given key value pair using strict comparison.
314338
*
@@ -401,6 +425,14 @@ public function first(callable $callback = null, $default = null);
401425
*/
402426
public function firstWhere($key, $operator = null, $value = null);
403427

428+
/**
429+
* Get a flattened array of the items in the collection.
430+
*
431+
* @param int $depth
432+
* @return static
433+
*/
434+
public function flatten($depth = INF);
435+
404436
/**
405437
* Flip the values with their keys.
406438
*
@@ -727,6 +759,22 @@ public function shuffle($seed = null);
727759
*/
728760
public function skip($count);
729761

762+
/**
763+
* Skip items in the collection until the given condition is met.
764+
*
765+
* @param mixed $value
766+
* @return static
767+
*/
768+
public function skipUntil($value);
769+
770+
/**
771+
* Skip items in the collection while the given condition is met.
772+
*
773+
* @param mixed $value
774+
* @return static
775+
*/
776+
public function skipWhile($value);
777+
730778
/**
731779
* Get a slice of items from the enumerable.
732780
*
@@ -828,6 +876,22 @@ public function sum($callback = null);
828876
*/
829877
public function take($limit);
830878

879+
/**
880+
* Take items in the collection until the given condition is met.
881+
*
882+
* @param mixed $value
883+
* @return static
884+
*/
885+
public function takeUntil($value);
886+
887+
/**
888+
* Take items in the collection while the given condition is met.
889+
*
890+
* @param mixed $value
891+
* @return static
892+
*/
893+
public function takeWhile($value);
894+
831895
/**
832896
* Pass the collection to the given callback and then return it.
833897
*
@@ -902,6 +966,17 @@ public function pad($size, $value);
902966
*/
903967
public function countBy($callback = null);
904968

969+
/**
970+
* Zip the collection together with one or more arrays.
971+
*
972+
* e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
973+
* => [[1, 4], [2, 5], [3, 6]]
974+
*
975+
* @param mixed ...$items
976+
* @return static
977+
*/
978+
public function zip($items);
979+
905980
/**
906981
* Collect the values into a collection.
907982
*

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -723,21 +723,6 @@ public function uniqueStrict($key = null)
723723
return $this->unique($key, true);
724724
}
725725

726-
/**
727-
* Take items in the collection until the given condition is met.
728-
*
729-
* This is an alias to the "takeUntil" method.
730-
*
731-
* @param mixed $value
732-
* @return static
733-
*
734-
* @deprecated Use the "takeUntil" method directly.
735-
*/
736-
public function until($value)
737-
{
738-
return $this->takeUntil($value);
739-
}
740-
741726
/**
742727
* Collect the values into a collection.
743728
*

src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ public function joiningTableSegment()
682682
*/
683683
public function touches($relation)
684684
{
685-
return in_array($relation, $this->touches);
685+
return in_array($relation, $this->getTouchedRelations());
686686
}
687687

688688
/**
@@ -692,7 +692,7 @@ public function touches($relation)
692692
*/
693693
public function touchOwners()
694694
{
695-
foreach ($this->touches as $relation) {
695+
foreach ($this->getTouchedRelations() as $relation) {
696696
$this->$relation()->touch();
697697

698698
if ($this->$relation instanceof self) {

0 commit comments

Comments
 (0)