From cada3d21c7f127ba01bb949b2fa045b7faaedbca Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 4 Mar 2021 14:07:30 +0100 Subject: [PATCH 01/41] Apply fixes from StyleCI (#36461) --- src/Illuminate/View/Engines/CompilerEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/View/Engines/CompilerEngine.php b/src/Illuminate/View/Engines/CompilerEngine.php index 1d38d310144c..afcba767fa88 100755 --- a/src/Illuminate/View/Engines/CompilerEngine.php +++ b/src/Illuminate/View/Engines/CompilerEngine.php @@ -3,8 +3,8 @@ namespace Illuminate\View\Engines; use Illuminate\View\Compilers\CompilerInterface; -use Throwable; use Illuminate\View\ViewException; +use Throwable; class CompilerEngine extends PhpEngine { From 6eadb692abd726128454cdcb3c634c64933582e0 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 9 Mar 2021 20:03:54 +0200 Subject: [PATCH 02/41] [8.x] update changelog --- CHANGELOG-8.x.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md index 28603d11124f..8dfc5721f3c9 100644 --- a/CHANGELOG-8.x.md +++ b/CHANGELOG-8.x.md @@ -1,6 +1,19 @@ # Release Notes for 8.x -## [Unreleased](https://github.com/laravel/framework/compare/v8.30.1...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.31.0...8.x) + + +## [v8.31.0 (2021-03-04)](https://github.com/laravel/framework/compare/v8.30.1...v8.31.0) + +### Added +- Added new `VendorTagPublished` event ([#36458](https://github.com/laravel/framework/pull/36458)) +- Added new `Stringable::test()` method ([#36462](https://github.com/laravel/framework/pull/36462)) + +### Reverted +- Reverted [Fixed `formatWheres()` methods in `DatabaseRule`](https://github.com/laravel/framework/pull/36441) ([#36452](https://github.com/laravel/framework/pull/36452)) + +### Changed +- Make user policy command fix (Windows) ([#36464](https://github.com/laravel/framework/pull/36464)) ## [v8.30.1 (2021-03-03)](https://github.com/laravel/framework/compare/v8.30.0...v8.30.1) From bbb6b97c48a22a13fc1c8cdae157ae6c42c9d07f Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 9 Mar 2021 20:09:54 +0200 Subject: [PATCH 03/41] [6.x] update changelog --- CHANGELOG-6.x.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 860012f0bd0a..b041da96c128 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,15 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.17...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.18...6.x) + + +## [v6.20.18 (2021-03-09)](https://github.com/laravel/framework/compare/v6.20.17...v6.20.18) + +### Fixed +- Fix validator treating null as true for (required|exclude)_(if|unless) due to loose `in_array()` check ([#36504](https://github.com/laravel/framework/pull/36504)) + +### Changed +- Delete existing links that are broken in `Illuminate\Foundation\Console\StorageLinkCommand` ([#36470](https://github.com/laravel/framework/pull/36470)) ## [v6.20.17 (2021-03-02)](https://github.com/laravel/framework/compare/v6.20.16...v6.20.17) From e1ff15be92072d45448e607e90651934b4d22362 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 9 Mar 2021 20:32:59 +0200 Subject: [PATCH 04/41] [8.x] update changelog --- CHANGELOG-8.x.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md index 8dfc5721f3c9..b70dcd9050d3 100644 --- a/CHANGELOG-8.x.md +++ b/CHANGELOG-8.x.md @@ -1,6 +1,27 @@ # Release Notes for 8.x -## [Unreleased](https://github.com/laravel/framework/compare/v8.31.0...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.32.0...8.x) + + +## [v8.32.0 (2021-03-09)](https://github.com/laravel/framework/compare/v8.31.0...v8.32.0) + +Added +- Phpredis lock serialization and compression support ([#36412](https://github.com/laravel/framework/pull/36412), [10f1a93](https://github.com/laravel/framework/commit/10f1a935205340ba8954e7075c1d9b67943db27d)) +- Added Fluent JSON Assertions ([#36454](https://github.com/laravel/framework/pull/36454)) +- Added methods to dump requests of the Laravel HTTP client ([#36466](https://github.com/laravel/framework/pull/36466)) +- Added `ThrottlesExceptions` and `ThrottlesExceptionsWithRedis` job middlewares for unstable services ([#36473](https://github.com/laravel/framework/pull/36473), [21fee76](https://github.com/laravel/framework/commit/21fee7649e1b48a7701b8ba860218741c2c3bcef), [36518](https://github.com/laravel/framework/pull/36518), [37e48ba](https://github.com/laravel/framework/commit/37e48ba864e2f463517429d41cefd94e88136c1c)) +- Added support to Eloquent Collection on `Model::destroy()` ([#36497](https://github.com/laravel/framework/pull/36497)) +- Added `rest` option to `php artisan queue:work` command ([#36521](https://github.com/laravel/framework/pull/36521), [c6ea49c](https://github.com/laravel/framework/commit/c6ea49c80a2ac93aebb8fdf2360161b73cec26af)) +- Added `prohibited_if` and `prohibited_unless` validation rules ([#36516](https://github.com/laravel/framework/pull/36516)) +- Added class `argument` to `Illuminate\Database\Console\Seeds\SeedCommand` ([#36513](https://github.com/laravel/framework/pull/36513)) + +### Fixed +- Fix validator treating null as true for (required|exclude)_(if|unless) due to loose `in_array()` check ([#36504](https://github.com/laravel/framework/pull/36504)) + +### Changed +- Delete existing links that are broken in `Illuminate\Foundation\Console\StorageLinkCommand` ([#36470](https://github.com/laravel/framework/pull/36470)) +- Use user provided url in AwsTemporaryUrl method ([#36480](https://github.com/laravel/framework/pull/36480)) +- Allow to override discover events base path ([#36515](https://github.com/laravel/framework/pull/36515)) ## [v8.31.0 (2021-03-04)](https://github.com/laravel/framework/compare/v8.30.1...v8.31.0) From 12b3d57c6f150e1b8def4535c347638113c22664 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 9 Mar 2021 20:35:12 +0200 Subject: [PATCH 05/41] [8.x] update changelog --- CHANGELOG-8.x.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md index b70dcd9050d3..e5ca8f3668f8 100644 --- a/CHANGELOG-8.x.md +++ b/CHANGELOG-8.x.md @@ -1,6 +1,12 @@ # Release Notes for 8.x -## [Unreleased](https://github.com/laravel/framework/compare/v8.32.0...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.32.1...8.x) + + +## [v8.32.1 (2021-03-09)](https://github.com/laravel/framework/compare/v8.32.0...v8.32.1) + +### Changed +- Changed `Illuminate\Queue\Middleware\ThrottlesExceptions` ([b8a70e9](https://github.com/laravel/framework/commit/b8a70e9a3685871ed46a24fc03c0267849d2d7c8)) ## [v8.32.0 (2021-03-09)](https://github.com/laravel/framework/compare/v8.31.0...v8.32.0) From b7ceae1761de6839e37b70a65177e702b1b4a38f Mon Sep 17 00:00:00 2001 From: Tom Irons Date: Wed, 10 Mar 2021 10:18:48 -0500 Subject: [PATCH 06/41] [8.x] Allow nullable columns for AsArrayObject/AsCollection casts (#36526) * Update AsArrayObject.php * Update AsCollection.php * return null * return null * formatting --- src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php | 2 +- src/Illuminate/Database/Eloquent/Casts/AsCollection.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php b/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php index 8d950e2daff4..a939e8acdbdb 100644 --- a/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php +++ b/src/Illuminate/Database/Eloquent/Casts/AsArrayObject.php @@ -18,7 +18,7 @@ public static function castUsing(array $arguments) return new class implements CastsAttributes { public function get($model, $key, $value, $attributes) { - return new ArrayObject(json_decode($attributes[$key], true)); + return isset($attributes[$key]) ? new ArrayObject(json_decode($attributes[$key], true)) : null; } public function set($model, $key, $value, $attributes) diff --git a/src/Illuminate/Database/Eloquent/Casts/AsCollection.php b/src/Illuminate/Database/Eloquent/Casts/AsCollection.php index e96834f6e4d3..c2d567b504f7 100644 --- a/src/Illuminate/Database/Eloquent/Casts/AsCollection.php +++ b/src/Illuminate/Database/Eloquent/Casts/AsCollection.php @@ -19,7 +19,7 @@ public static function castUsing(array $arguments) return new class implements CastsAttributes { public function get($model, $key, $value, $attributes) { - return new Collection(json_decode($attributes[$key], true)); + return isset($attributes[$key]) ? new Collection(json_decode($attributes[$key], true)) : null; } public function set($model, $key, $value, $attributes) From 5d093e276abff36b8b4e75541e13ca54829cc75c Mon Sep 17 00:00:00 2001 From: Sibghatullah Mujaddid Date: Thu, 11 Mar 2021 11:31:35 +0800 Subject: [PATCH 07/41] Accept callable class for reportable and renderable in exception handler (#36551) --- .../Foundation/Exceptions/Handler.php | 8 ++++ .../FoundationExceptionsHandlerTest.php | 48 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/Illuminate/Foundation/Exceptions/Handler.php b/src/Illuminate/Foundation/Exceptions/Handler.php index 38c29a3996c7..bedb1fca3be4 100644 --- a/src/Illuminate/Foundation/Exceptions/Handler.php +++ b/src/Illuminate/Foundation/Exceptions/Handler.php @@ -139,6 +139,10 @@ public function register() */ public function reportable(callable $reportUsing) { + if (! $reportUsing instanceof Closure) { + $reportUsing = Closure::fromCallable($reportUsing); + } + return tap(new ReportableHandler($reportUsing), function ($callback) { $this->reportCallbacks[] = $callback; }); @@ -152,6 +156,10 @@ public function reportable(callable $reportUsing) */ public function renderable(callable $renderUsing) { + if (! $renderUsing instanceof Closure) { + $renderUsing = Closure::fromCallable($renderUsing); + } + $this->renderCallbacks[] = $renderUsing; return $this; diff --git a/tests/Foundation/FoundationExceptionsHandlerTest.php b/tests/Foundation/FoundationExceptionsHandlerTest.php index 55b2d54982a5..755a01d9f31e 100644 --- a/tests/Foundation/FoundationExceptionsHandlerTest.php +++ b/tests/Foundation/FoundationExceptionsHandlerTest.php @@ -107,6 +107,20 @@ public function testHandlerCallsReportMethodWithDependencies() $this->handler->report(new ReportableException('Exception message')); } + public function testHandlerReportsExceptionUsingCallableClass() + { + $reporter = m::mock(ReportingService::class); + $reporter->shouldReceive('send')->withArgs(['Exception message'])->once(); + + $logger = m::mock(LoggerInterface::class); + $this->container->instance(LoggerInterface::class, $logger); + $logger->shouldNotReceive('error'); + + $this->handler->reportable(new CustomReporter($reporter)); + + $this->handler->report(new CustomException('Exception message')); + } + public function testReturnsJsonWithStackTraceWhenAjaxRequestAndDebugTrue() { $this->config->shouldReceive('get')->with('app.debug', null)->once()->andReturn(true); @@ -134,6 +148,15 @@ public function testReturnsCustomResponseFromRenderableCallback() $this->assertSame('{"response":"My custom exception response"}', $response); } + public function testReturnsCustomResponseFromCallableClass() + { + $this->handler->renderable(new CustomRenderer()); + + $response = $this->handler->render($this->request, new CustomException)->getContent(); + + $this->assertSame('{"response":"The CustomRenderer response"}', $response); + } + public function testReturnsCustomResponseWhenExceptionImplementsResponsable() { $response = $this->handler->render($this->request, new ResponsableException)->getContent(); @@ -302,6 +325,31 @@ public function context() } } +class CustomReporter +{ + private $service; + + public function __construct(ReportingService $service) + { + $this->service = $service; + } + + public function __invoke(CustomException $e) + { + $this->service->send($e->getMessage()); + + return false; + } +} + +class CustomRenderer +{ + public function __invoke(CustomException $e, $request) + { + return response()->json(['response' => 'The CustomRenderer response']); + } +} + interface ReportingService { public function send($message); From dd7274d23a9ee58cc1abdf7107403169a3994b68 Mon Sep 17 00:00:00 2001 From: Ahmed Ashraf Date: Wed, 10 Mar 2021 18:03:35 +0100 Subject: [PATCH 08/41] [8.x] Container - detect circular dependencies --- src/Illuminate/Container/Container.php | 8 +++++- .../CircularDependencyFoundException.php | 11 ++++++++ tests/Container/ContainerTest.php | 26 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/Illuminate/Contracts/Container/CircularDependencyFoundException.php diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index 2cfa72f51bb7..abf94c99861c 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -6,6 +6,7 @@ use Closure; use Exception; use Illuminate\Contracts\Container\BindingResolutionException; +use Illuminate\Contracts\Container\CircularDependencyFoundException; use Illuminate\Contracts\Container\Container as ContainerContract; use LogicException; use ReflectionClass; @@ -659,7 +660,7 @@ public function get($id) try { return $this->resolve($id); } catch (Exception $e) { - if ($this->has($id)) { + if ($this->has($id) || $e instanceof CircularDependencyFoundException) { throw $e; } @@ -839,6 +840,11 @@ public function build($concrete) return $this->notInstantiable($concrete); } + // Check for circular dependencies + if(in_array($concrete, $this->buildStack)) { + throw new CircularDependencyFoundException("Circular dependency while initiating [{$concrete}]"); + } + $this->buildStack[] = $concrete; $constructor = $reflector->getConstructor(); diff --git a/src/Illuminate/Contracts/Container/CircularDependencyFoundException.php b/src/Illuminate/Contracts/Container/CircularDependencyFoundException.php new file mode 100644 index 000000000000..d6d0398e93ef --- /dev/null +++ b/src/Illuminate/Contracts/Container/CircularDependencyFoundException.php @@ -0,0 +1,11 @@ +assertInstanceOf(ContainerConcreteStub::class, $class); } + + public function testContainerCanCatchCircularDependency() { + $this->expectException(CircularDependencyFoundException::class); + + $container = new Container; + $container->get(CircularAStub::class); + } +} + +class CircularAStub { + public function __construct(CircularBStub $b) { + + } +} + +class CircularBStub { + public function __construct(CircularCStub $c) { + + } +} + +class CircularCStub { + public function __construct(CircularAStub $a) { + + } } class ContainerConcreteStub From 0f79023f0b176a5ac69a878d642431c402880210 Mon Sep 17 00:00:00 2001 From: Ahmed Ashraf Date: Wed, 10 Mar 2021 18:15:33 +0100 Subject: [PATCH 09/41] update doc --- src/Illuminate/Container/Container.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index abf94c99861c..ad3f6a516f2a 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -671,12 +671,13 @@ public function get($id) /** * Resolve the given type from the container. * - * @param string|callable $abstract - * @param array $parameters - * @param bool $raiseEvents + * @param string|callable $abstract + * @param array $parameters + * @param bool $raiseEvents * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException + * @throws \Illuminate\Contracts\Container\CircularDependencyFoundException */ protected function resolve($abstract, $parameters = [], $raiseEvents = true) { @@ -813,10 +814,11 @@ protected function isBuildable($concrete, $abstract) /** * Instantiate a concrete instance of the given type. * - * @param \Closure|string $concrete + * @param \Closure|string $concrete * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException + * @throws \Illuminate\Contracts\Container\CircularDependencyFoundException */ public function build($concrete) { From a712f72ca88f709335576530b31635738abd4c89 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 10 Mar 2021 21:44:47 -0600 Subject: [PATCH 10/41] formatting --- src/Illuminate/Container/Container.php | 21 +++++++++---------- .../CircularDependencyFoundException.php | 11 ---------- tests/Container/ContainerTest.php | 4 ++-- 3 files changed, 12 insertions(+), 24 deletions(-) delete mode 100644 src/Illuminate/Contracts/Container/CircularDependencyFoundException.php diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index ad3f6a516f2a..4ea378983d0d 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -6,7 +6,7 @@ use Closure; use Exception; use Illuminate\Contracts\Container\BindingResolutionException; -use Illuminate\Contracts\Container\CircularDependencyFoundException; +use Illuminate\Contracts\Container\CircularDependencyException; use Illuminate\Contracts\Container\Container as ContainerContract; use LogicException; use ReflectionClass; @@ -660,7 +660,7 @@ public function get($id) try { return $this->resolve($id); } catch (Exception $e) { - if ($this->has($id) || $e instanceof CircularDependencyFoundException) { + if ($this->has($id) || $e instanceof CircularDependencyException) { throw $e; } @@ -671,13 +671,13 @@ public function get($id) /** * Resolve the given type from the container. * - * @param string|callable $abstract - * @param array $parameters - * @param bool $raiseEvents + * @param string|callable $abstract + * @param array $parameters + * @param bool $raiseEvents * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException - * @throws \Illuminate\Contracts\Container\CircularDependencyFoundException + * @throws \Illuminate\Contracts\Container\CircularDependencyException */ protected function resolve($abstract, $parameters = [], $raiseEvents = true) { @@ -814,11 +814,11 @@ protected function isBuildable($concrete, $abstract) /** * Instantiate a concrete instance of the given type. * - * @param \Closure|string $concrete + * @param \Closure|string $concrete * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException - * @throws \Illuminate\Contracts\Container\CircularDependencyFoundException + * @throws \Illuminate\Contracts\Container\CircularDependencyException */ public function build($concrete) { @@ -842,9 +842,8 @@ public function build($concrete) return $this->notInstantiable($concrete); } - // Check for circular dependencies - if(in_array($concrete, $this->buildStack)) { - throw new CircularDependencyFoundException("Circular dependency while initiating [{$concrete}]"); + if (in_array($concrete, $this->buildStack)) { + throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); } $this->buildStack[] = $concrete; diff --git a/src/Illuminate/Contracts/Container/CircularDependencyFoundException.php b/src/Illuminate/Contracts/Container/CircularDependencyFoundException.php deleted file mode 100644 index d6d0398e93ef..000000000000 --- a/src/Illuminate/Contracts/Container/CircularDependencyFoundException.php +++ /dev/null @@ -1,11 +0,0 @@ -expectException(CircularDependencyFoundException::class); + $this->expectException(CircularDependencyException::class); $container = new Container; $container->get(CircularAStub::class); From 6f9bb4cdd84295cbcf7908cc4b4684f47f38b8cf Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 10 Mar 2021 21:44:53 -0600 Subject: [PATCH 11/41] formatting --- .../Container/CircularDependencyException.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/Illuminate/Contracts/Container/CircularDependencyException.php diff --git a/src/Illuminate/Contracts/Container/CircularDependencyException.php b/src/Illuminate/Contracts/Container/CircularDependencyException.php new file mode 100644 index 000000000000..6c90381cc0cd --- /dev/null +++ b/src/Illuminate/Contracts/Container/CircularDependencyException.php @@ -0,0 +1,11 @@ + Date: Wed, 10 Mar 2021 21:45:44 -0600 Subject: [PATCH 12/41] Apply fixes from StyleCI (#36553) --- tests/Container/ContainerTest.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/Container/ContainerTest.php b/tests/Container/ContainerTest.php index 27ddca9a12b5..8b5fe7a23a88 100755 --- a/tests/Container/ContainerTest.php +++ b/tests/Container/ContainerTest.php @@ -564,7 +564,8 @@ public function testContainerCanResolveClasses() $this->assertInstanceOf(ContainerConcreteStub::class, $class); } - public function testContainerCanCatchCircularDependency() { + public function testContainerCanCatchCircularDependency() + { $this->expectException(CircularDependencyException::class); $container = new Container; @@ -572,21 +573,24 @@ public function testContainerCanCatchCircularDependency() { } } -class CircularAStub { - public function __construct(CircularBStub $b) { - +class CircularAStub +{ + public function __construct(CircularBStub $b) + { } } -class CircularBStub { - public function __construct(CircularCStub $c) { - +class CircularBStub +{ + public function __construct(CircularCStub $c) + { } } -class CircularCStub { - public function __construct(CircularAStub $a) { - +class CircularCStub +{ + public function __construct(CircularAStub $a) + { } } From d5cd4b3ee7e4db527c5a089af78183e6742afeb5 Mon Sep 17 00:00:00 2001 From: Sevan Nerse Date: Thu, 11 Mar 2021 16:39:04 +0300 Subject: [PATCH 13/41] Add test for stack prepend (#36555) --- tests/View/ViewFactoryTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/View/ViewFactoryTest.php b/tests/View/ViewFactoryTest.php index ab003c3b9f9d..1419f502706c 100755 --- a/tests/View/ViewFactoryTest.php +++ b/tests/View/ViewFactoryTest.php @@ -443,6 +443,27 @@ public function testMultipleStackPush() $this->assertSame('hi, Hello!', $factory->yieldPushContent('foo')); } + public function testSingleStackPrepend() + { + $factory = $this->getFactory(); + $factory->startPrepend('foo'); + echo 'hi'; + $factory->stopPrepend(); + $this->assertSame('hi', $factory->yieldPushContent('foo')); + } + + public function testMultipleStackPrepend() + { + $factory = $this->getFactory(); + $factory->startPrepend('foo'); + echo ', Hello!'; + $factory->stopPrepend(); + $factory->startPrepend('foo'); + echo 'hi'; + $factory->stopPrepend(); + $this->assertSame('hi, Hello!', $factory->yieldPushContent('foo')); + } + public function testSessionAppending() { $factory = $this->getFactory(); From 2d304d4e5dc49c5f80e0ee77cf44d08e8d94325d Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 11 Mar 2021 14:55:37 +0100 Subject: [PATCH 14/41] Consolidate empty function bodies (#36560) --- src/Illuminate/Events/NullDispatcher.php | 3 +++ src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php | 5 +++++ src/Illuminate/Support/Testing/Fakes/BusFake.php | 1 + tests/Container/ContainerTest.php | 3 +++ tests/Integration/Queue/CustomPayloadTest.php | 1 + tests/Support/SupportReflectorTest.php | 4 ++++ 6 files changed, 17 insertions(+) diff --git a/src/Illuminate/Events/NullDispatcher.php b/src/Illuminate/Events/NullDispatcher.php index 5c020cfdd732..5c539d53a361 100644 --- a/src/Illuminate/Events/NullDispatcher.php +++ b/src/Illuminate/Events/NullDispatcher.php @@ -37,6 +37,7 @@ public function __construct(DispatcherContract $dispatcher) */ public function dispatch($event, $payload = [], $halt = false) { + // } /** @@ -48,6 +49,7 @@ public function dispatch($event, $payload = [], $halt = false) */ public function push($event, $payload = []) { + // } /** @@ -59,6 +61,7 @@ public function push($event, $payload = []) */ public function until($event, $payload = []) { + // } /** diff --git a/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php b/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php index 55681f4d5534..d9661334ce01 100644 --- a/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php +++ b/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php @@ -33,6 +33,7 @@ public function get($limit, $before) */ public function find(string $batchId) { + // } /** @@ -68,6 +69,7 @@ public function store(PendingBatch $batch) */ public function incrementTotalJobs(string $batchId, int $amount) { + // } /** @@ -102,6 +104,7 @@ public function incrementFailedJobs(string $batchId, string $jobId) */ public function markAsFinished(string $batchId) { + // } /** @@ -112,6 +115,7 @@ public function markAsFinished(string $batchId) */ public function cancel(string $batchId) { + // } /** @@ -122,6 +126,7 @@ public function cancel(string $batchId) */ public function delete(string $batchId) { + // } /** diff --git a/src/Illuminate/Support/Testing/Fakes/BusFake.php b/src/Illuminate/Support/Testing/Fakes/BusFake.php index 5b5b68534583..82f3dda5d129 100644 --- a/src/Illuminate/Support/Testing/Fakes/BusFake.php +++ b/src/Illuminate/Support/Testing/Fakes/BusFake.php @@ -517,6 +517,7 @@ public function chain($jobs) */ public function findBatch(string $batchId) { + // } /** diff --git a/tests/Container/ContainerTest.php b/tests/Container/ContainerTest.php index 8b5fe7a23a88..39638694f802 100755 --- a/tests/Container/ContainerTest.php +++ b/tests/Container/ContainerTest.php @@ -577,6 +577,7 @@ class CircularAStub { public function __construct(CircularBStub $b) { + // } } @@ -584,6 +585,7 @@ class CircularBStub { public function __construct(CircularCStub $c) { + // } } @@ -591,6 +593,7 @@ class CircularCStub { public function __construct(CircularAStub $a) { + // } } diff --git a/tests/Integration/Queue/CustomPayloadTest.php b/tests/Integration/Queue/CustomPayloadTest.php index 3d1088b52c4d..2ce39544be34 100644 --- a/tests/Integration/Queue/CustomPayloadTest.php +++ b/tests/Integration/Queue/CustomPayloadTest.php @@ -60,5 +60,6 @@ class MyJob implements ShouldQueue public function handle() { + // } } diff --git a/tests/Support/SupportReflectorTest.php b/tests/Support/SupportReflectorTest.php index df5b3e414e46..deebed5aabc7 100644 --- a/tests/Support/SupportReflectorTest.php +++ b/tests/Support/SupportReflectorTest.php @@ -81,6 +81,7 @@ class B extends A { public function f(parent $x) { + // } } @@ -92,6 +93,7 @@ class C { public function f(A|Model $x) { + // } }' ); @@ -101,6 +103,7 @@ class TestClassWithCall { public function __call($method, $parameters) { + // } } @@ -108,5 +111,6 @@ class TestClassWithCallStatic { public static function __callStatic($method, $parameters) { + // } } From 36f5aac531f0dfd148b45be7960188db12d80f9a Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 11 Mar 2021 14:56:28 +0100 Subject: [PATCH 15/41] Fix returns with Mail & Notification components (#36559) These methods were incorrectly returning values. Since nothing was returned in the first place and the proper DocBlocks were already in place, this should be a general safe thing to do. --- src/Illuminate/Mail/Mailable.php | 2 +- src/Illuminate/Mail/Mailer.php | 6 +++--- src/Illuminate/Mail/PendingMail.php | 4 ++-- src/Illuminate/Notifications/ChannelManager.php | 4 ++-- src/Illuminate/Notifications/NotificationSender.php | 2 +- src/Illuminate/Support/Testing/Fakes/EventFake.php | 2 +- src/Illuminate/Support/Testing/Fakes/NotificationFake.php | 2 +- src/Illuminate/Support/Testing/Fakes/PendingMailFake.php | 4 ++-- src/Illuminate/Support/Testing/Fakes/QueueFake.php | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Illuminate/Mail/Mailable.php b/src/Illuminate/Mail/Mailable.php index 1fe0b7ea3d20..903bd5f5f41b 100644 --- a/src/Illuminate/Mail/Mailable.php +++ b/src/Illuminate/Mail/Mailable.php @@ -170,7 +170,7 @@ class Mailable implements MailableContract, Renderable */ public function send($mailer) { - return $this->withLocale($this->locale, function () use ($mailer) { + $this->withLocale($this->locale, function () use ($mailer) { Container::getInstance()->call([$this, 'build']); $mailer = $mailer instanceof MailFactory diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index 668d68baaf2a..128f211f7651 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -197,7 +197,7 @@ public function bcc($users) */ public function html($html, $callback) { - return $this->send(['html' => new HtmlString($html)], [], $callback); + $this->send(['html' => new HtmlString($html)], [], $callback); } /** @@ -209,7 +209,7 @@ public function html($html, $callback) */ public function raw($text, $callback) { - return $this->send(['raw' => $text], [], $callback); + $this->send(['raw' => $text], [], $callback); } /** @@ -222,7 +222,7 @@ public function raw($text, $callback) */ public function plain($view, array $data, $callback) { - return $this->send(['text' => $view], $data, $callback); + $this->send(['text' => $view], $data, $callback); } /** diff --git a/src/Illuminate/Mail/PendingMail.php b/src/Illuminate/Mail/PendingMail.php index 43c30961f90b..10d76cb6aa9b 100644 --- a/src/Illuminate/Mail/PendingMail.php +++ b/src/Illuminate/Mail/PendingMail.php @@ -114,11 +114,11 @@ public function bcc($users) * Send a new mailable message instance. * * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return mixed + * @return void */ public function send(MailableContract $mailable) { - return $this->mailer->send($this->fill($mailable)); + $this->mailer->send($this->fill($mailable)); } /** diff --git a/src/Illuminate/Notifications/ChannelManager.php b/src/Illuminate/Notifications/ChannelManager.php index d2344ab68acc..8eb9c251024d 100644 --- a/src/Illuminate/Notifications/ChannelManager.php +++ b/src/Illuminate/Notifications/ChannelManager.php @@ -34,7 +34,7 @@ class ChannelManager extends Manager implements DispatcherContract, FactoryContr */ public function send($notifiables, $notification) { - return (new NotificationSender( + (new NotificationSender( $this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale) )->send($notifiables, $notification); } @@ -49,7 +49,7 @@ public function send($notifiables, $notification) */ public function sendNow($notifiables, $notification, array $channels = null) { - return (new NotificationSender( + (new NotificationSender( $this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale) )->sendNow($notifiables, $notification, $channels); } diff --git a/src/Illuminate/Notifications/NotificationSender.php b/src/Illuminate/Notifications/NotificationSender.php index 39be0e598796..aff36c7a5b0f 100644 --- a/src/Illuminate/Notifications/NotificationSender.php +++ b/src/Illuminate/Notifications/NotificationSender.php @@ -76,7 +76,7 @@ public function send($notifiables, $notification) return $this->queueNotification($notifiables, $notification); } - return $this->sendNow($notifiables, $notification); + $this->sendNow($notifiables, $notification); } /** diff --git a/src/Illuminate/Support/Testing/Fakes/EventFake.php b/src/Illuminate/Support/Testing/Fakes/EventFake.php index 90f30212ef7b..88fcb84cea48 100644 --- a/src/Illuminate/Support/Testing/Fakes/EventFake.php +++ b/src/Illuminate/Support/Testing/Fakes/EventFake.php @@ -278,7 +278,7 @@ public function forgetPushed() * * @param string|object $event * @param mixed $payload - * @return void + * @return array|null */ public function until($event, $payload = []) { diff --git a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php index cf3a25afd696..28526d592556 100644 --- a/src/Illuminate/Support/Testing/Fakes/NotificationFake.php +++ b/src/Illuminate/Support/Testing/Fakes/NotificationFake.php @@ -210,7 +210,7 @@ protected function notificationsFor($notifiable, $notification) */ public function send($notifiables, $notification) { - return $this->sendNow($notifiables, $notification); + $this->sendNow($notifiables, $notification); } /** diff --git a/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php b/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php index c39012501ae6..52251301ceb9 100644 --- a/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php +++ b/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php @@ -22,11 +22,11 @@ public function __construct($mailer) * Send a new mailable message instance. * * @param \Illuminate\Contracts\Mail\Mailable $mailable - * @return mixed + * @return void */ public function send(Mailable $mailable) { - return $this->mailer->send($this->fill($mailable)); + $this->mailer->send($this->fill($mailable)); } /** diff --git a/src/Illuminate/Support/Testing/Fakes/QueueFake.php b/src/Illuminate/Support/Testing/Fakes/QueueFake.php index e83408fc0c74..64d6414fd81b 100644 --- a/src/Illuminate/Support/Testing/Fakes/QueueFake.php +++ b/src/Illuminate/Support/Testing/Fakes/QueueFake.php @@ -74,7 +74,7 @@ public function assertPushedOn($queue, $job, $callback = null) [$job, $callback] = [$this->firstClosureParameterType($job), $job]; } - return $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) { + $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) { if ($pushedQueue !== $queue) { return false; } From 62925b64310bb796dff479aea4acc55a1620d470 Mon Sep 17 00:00:00 2001 From: Olzhas Date: Thu, 11 Mar 2021 21:08:31 +0600 Subject: [PATCH 16/41] Add resource missing option --- .../Routing/PendingResourceRegistration.php | 13 +++++++++++++ src/Illuminate/Routing/ResourceRegistrar.php | 11 +++++++++++ tests/Routing/RouteRegistrarTest.php | 16 ++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/src/Illuminate/Routing/PendingResourceRegistration.php b/src/Illuminate/Routing/PendingResourceRegistration.php index 3b6c97e2042d..d2bb33c65de2 100644 --- a/src/Illuminate/Routing/PendingResourceRegistration.php +++ b/src/Illuminate/Routing/PendingResourceRegistration.php @@ -195,6 +195,19 @@ public function shallow($shallow = true) return $this; } + /** + * Define the callable that should be invoked on a missing model exception. + * + * @param $callback + * @return $this + */ + public function missing($callback) + { + $this->options['missing'] = $callback; + + return $this; + } + /** * Indicate that the resource routes should be scoped using the given binding fields. * diff --git a/src/Illuminate/Routing/ResourceRegistrar.php b/src/Illuminate/Routing/ResourceRegistrar.php index c32aa023b4bd..d52264456af1 100644 --- a/src/Illuminate/Routing/ResourceRegistrar.php +++ b/src/Illuminate/Routing/ResourceRegistrar.php @@ -20,6 +20,13 @@ class ResourceRegistrar */ protected $resourceDefaults = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy']; + /** + * Actions that use model binding. + * + * @var string[] + */ + protected $modelBoundMethods = ['show', 'edit', 'update', 'destroy']; + /** * The parameters set for this resource instance. * @@ -421,6 +428,10 @@ protected function getResourceAction($resource, $controller, $method, $options) $action['where'] = $options['wheres']; } + if (isset($options['missing']) && in_array($method, $this->modelBoundMethods)) { + $action['missing'] = $options['missing']; + } + return $action; } diff --git a/tests/Routing/RouteRegistrarTest.php b/tests/Routing/RouteRegistrarTest.php index 47fcb2aa31e5..831ced92fdfb 100644 --- a/tests/Routing/RouteRegistrarTest.php +++ b/tests/Routing/RouteRegistrarTest.php @@ -334,6 +334,22 @@ public function testCanRegisterResourcesWithoutOption() } } + public function testCanRegisterResourceWithMissingOption() + { + $this->router->middleware('resource-middleware') + ->resource('users', RouteRegistrarControllerStub::class) + ->missing(function () { return 'missing'; }); + + $this->assertIsCallable($this->router->getRoutes()->getByName('users.show')->getMissing()); + $this->assertIsCallable($this->router->getRoutes()->getByName('users.edit')->getMissing()); + $this->assertIsCallable($this->router->getRoutes()->getByName('users.update')->getMissing()); + $this->assertIsCallable($this->router->getRoutes()->getByName('users.destroy')->getMissing()); + + $this->assertNull($this->router->getRoutes()->getByName('users.index')->getMissing()); + $this->assertNull($this->router->getRoutes()->getByName('users.create')->getMissing()); + $this->assertNull($this->router->getRoutes()->getByName('users.store')->getMissing()); + } + public function testCanAccessRegisteredResourceRoutesAsRouteCollection() { $resource = $this->router->middleware('resource-middleware') From c887875c23f393e3443b1fd2a8dd0c748e6f13ea Mon Sep 17 00:00:00 2001 From: Olzhas Date: Thu, 11 Mar 2021 21:25:07 +0600 Subject: [PATCH 17/41] Add resource missing option --- src/Illuminate/Routing/ResourceRegistrar.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Routing/ResourceRegistrar.php b/src/Illuminate/Routing/ResourceRegistrar.php index d52264456af1..c32de58c291f 100644 --- a/src/Illuminate/Routing/ResourceRegistrar.php +++ b/src/Illuminate/Routing/ResourceRegistrar.php @@ -20,13 +20,6 @@ class ResourceRegistrar */ protected $resourceDefaults = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy']; - /** - * Actions that use model binding. - * - * @var string[] - */ - protected $modelBoundMethods = ['show', 'edit', 'update', 'destroy']; - /** * The parameters set for this resource instance. * @@ -191,6 +184,8 @@ protected function addResourceIndex($name, $base, $controller, $options) { $uri = $this->getResourceUri($name); + unset($options['missing']); + $action = $this->getResourceAction($name, $controller, 'index', $options); return $this->router->get($uri, $action); @@ -209,6 +204,8 @@ protected function addResourceCreate($name, $base, $controller, $options) { $uri = $this->getResourceUri($name).'/'.static::$verbs['create']; + unset($options['missing']); + $action = $this->getResourceAction($name, $controller, 'create', $options); return $this->router->get($uri, $action); @@ -227,6 +224,8 @@ protected function addResourceStore($name, $base, $controller, $options) { $uri = $this->getResourceUri($name); + unset($options['missing']); + $action = $this->getResourceAction($name, $controller, 'store', $options); return $this->router->post($uri, $action); @@ -428,7 +427,7 @@ protected function getResourceAction($resource, $controller, $method, $options) $action['where'] = $options['wheres']; } - if (isset($options['missing']) && in_array($method, $this->modelBoundMethods)) { + if (isset($options['missing'])) { $action['missing'] = $options['missing']; } From 61db3ef0e82b0ff5170100e2ea5198a195ac2743 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 11 Mar 2021 17:23:18 +0100 Subject: [PATCH 18/41] Update to ubuntu-20.04 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7b91b6fe781..1a81af4975b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ on: jobs: linux_tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 services: memcached: From 65c8e0c13323862d6e65432468bea2924e490629 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 12 Mar 2021 00:04:53 +0100 Subject: [PATCH 19/41] Fix Mailer contract returns (#36563) --- src/Illuminate/Contracts/Mail/Factory.php | 2 +- src/Illuminate/Mail/MailManager.php | 2 +- src/Illuminate/Support/Testing/Fakes/MailFake.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Contracts/Mail/Factory.php b/src/Illuminate/Contracts/Mail/Factory.php index 0719c0514595..fe45a2fd9cd8 100644 --- a/src/Illuminate/Contracts/Mail/Factory.php +++ b/src/Illuminate/Contracts/Mail/Factory.php @@ -8,7 +8,7 @@ interface Factory * Get a mailer instance by name. * * @param string|null $name - * @return \Illuminate\Mail\Mailer + * @return \Illuminate\Contracts\Mail\Mailer */ public function mailer($name = null); } diff --git a/src/Illuminate/Mail/MailManager.php b/src/Illuminate/Mail/MailManager.php index 97fcda7827c5..86acdde3e3aa 100644 --- a/src/Illuminate/Mail/MailManager.php +++ b/src/Illuminate/Mail/MailManager.php @@ -63,7 +63,7 @@ public function __construct($app) * Get a mailer instance by name. * * @param string|null $name - * @return \Illuminate\Mail\Mailer + * @return \Illuminate\Contracts\Mail\Mailer */ public function mailer($name = null) { diff --git a/src/Illuminate/Support/Testing/Fakes/MailFake.php b/src/Illuminate/Support/Testing/Fakes/MailFake.php index eb548b6910b3..a42fe341f40e 100644 --- a/src/Illuminate/Support/Testing/Fakes/MailFake.php +++ b/src/Illuminate/Support/Testing/Fakes/MailFake.php @@ -276,7 +276,7 @@ protected function queuedMailablesOf($type) * Get a mailer instance by name. * * @param string|null $name - * @return \Illuminate\Mail\Mailer + * @return \Illuminate\Contracts\Mail\Mailer */ public function mailer($name = null) { From be86b91ca8812a2564cba71f859ebf410ca1f571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 12 Mar 2021 14:52:50 +0100 Subject: [PATCH 20/41] [6.x] add make method to App facade (#36574) --- src/Illuminate/Support/Facades/App.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Support/Facades/App.php b/src/Illuminate/Support/Facades/App.php index 67e0b4c233e4..0bc5b34254d3 100755 --- a/src/Illuminate/Support/Facades/App.php +++ b/src/Illuminate/Support/Facades/App.php @@ -19,6 +19,7 @@ * @method static \Illuminate\Support\ServiceProvider register(\Illuminate\Support\ServiceProvider|string $provider, bool $force = false) * @method static void registerDeferredProvider(string $provider, string $service = null) * @method static \Illuminate\Support\ServiceProvider resolveProvider(string $provider) + * @method static mixed make($abstract, array $parameters = []) * @method static void boot() * @method static void booting(callable $callback) * @method static void booted(callable $callback) From cf9b74985e882c2405a9f6068cdd9bacfc9433a0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 12 Mar 2021 08:11:27 -0600 Subject: [PATCH 21/41] formatting --- src/Illuminate/Routing/PendingResourceRegistration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Routing/PendingResourceRegistration.php b/src/Illuminate/Routing/PendingResourceRegistration.php index d2bb33c65de2..59e4b8f0b78f 100644 --- a/src/Illuminate/Routing/PendingResourceRegistration.php +++ b/src/Illuminate/Routing/PendingResourceRegistration.php @@ -198,7 +198,7 @@ public function shallow($shallow = true) /** * Define the callable that should be invoked on a missing model exception. * - * @param $callback + * @param callable $callback * @return $this */ public function missing($callback) From 6d1da017689c004efece0bde8c3790202c359a31 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 12 Mar 2021 08:12:04 -0600 Subject: [PATCH 22/41] Apply fixes from StyleCI (#36577) --- tests/Routing/RouteRegistrarTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Routing/RouteRegistrarTest.php b/tests/Routing/RouteRegistrarTest.php index 831ced92fdfb..9802ad742a61 100644 --- a/tests/Routing/RouteRegistrarTest.php +++ b/tests/Routing/RouteRegistrarTest.php @@ -338,7 +338,9 @@ public function testCanRegisterResourceWithMissingOption() { $this->router->middleware('resource-middleware') ->resource('users', RouteRegistrarControllerStub::class) - ->missing(function () { return 'missing'; }); + ->missing(function () { + return 'missing'; + }); $this->assertIsCallable($this->router->getRoutes()->getByName('users.show')->getMissing()); $this->assertIsCallable($this->router->getRoutes()->getByName('users.edit')->getMissing()); From e4ed3317c2730803925918e1cb1e1e739e20ba5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20Deleu?= Date: Fri, 12 Mar 2021 15:45:30 +0100 Subject: [PATCH 23/41] [8.x] StringEncrypter interface for better DX (#36578) * StringEncrypter interface for better DX * StyleCI * Update Encrypter.php Co-authored-by: Taylor Otwell --- .../Contracts/Encryption/StringEncrypter.php | 26 +++++++++++++++++++ src/Illuminate/Encryption/Encrypter.php | 3 ++- src/Illuminate/Foundation/Application.php | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/Illuminate/Contracts/Encryption/StringEncrypter.php diff --git a/src/Illuminate/Contracts/Encryption/StringEncrypter.php b/src/Illuminate/Contracts/Encryption/StringEncrypter.php new file mode 100644 index 000000000000..1e6938c29a16 --- /dev/null +++ b/src/Illuminate/Contracts/Encryption/StringEncrypter.php @@ -0,0 +1,26 @@ + [\Symfony\Component\Cache\Adapter\Psr16Adapter::class, \Symfony\Component\Cache\Adapter\AdapterInterface::class, \Psr\Cache\CacheItemPoolInterface::class], 'config' => [\Illuminate\Config\Repository::class, \Illuminate\Contracts\Config\Repository::class], 'cookie' => [\Illuminate\Cookie\CookieJar::class, \Illuminate\Contracts\Cookie\Factory::class, \Illuminate\Contracts\Cookie\QueueingFactory::class], - 'encrypter' => [\Illuminate\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\Encrypter::class], 'db' => [\Illuminate\Database\DatabaseManager::class, \Illuminate\Database\ConnectionResolverInterface::class], 'db.connection' => [\Illuminate\Database\Connection::class, \Illuminate\Database\ConnectionInterface::class], + 'encrypter' => [\Illuminate\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\StringEncrypter::class], 'events' => [\Illuminate\Events\Dispatcher::class, \Illuminate\Contracts\Events\Dispatcher::class], 'files' => [\Illuminate\Filesystem\Filesystem::class], 'filesystem' => [\Illuminate\Filesystem\FilesystemManager::class, \Illuminate\Contracts\Filesystem\Factory::class], From a69f15d30522eb3c1db5786c6df8a6d4f87bd0a3 Mon Sep 17 00:00:00 2001 From: Markus Machatschek Date: Mon, 15 Mar 2021 14:32:05 +0100 Subject: [PATCH 24/41] Add ssl broken pipe as lost connection error (#36601) --- src/Illuminate/Database/DetectsLostConnections.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php index 1ecfc96140f4..a0bad6718017 100644 --- a/src/Illuminate/Database/DetectsLostConnections.php +++ b/src/Illuminate/Database/DetectsLostConnections.php @@ -50,6 +50,7 @@ protected function causedByLostConnection(Throwable $e) 'SSL: Connection timed out', 'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.', 'Temporary failure in name resolution', + 'SSL: Broken pipe', ]); } } From ddab370272942f456b0632b8f1d5d957266262cd Mon Sep 17 00:00:00 2001 From: Zubair Mohsin Date: Mon, 15 Mar 2021 18:36:05 +0500 Subject: [PATCH 25/41] Initializes CronExpression class using new (#36600) --- src/Illuminate/Console/Scheduling/Event.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index a680c1a64cb0..b3ab9b2db567 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -328,7 +328,7 @@ protected function expressionPasses() $date->setTimezone($this->timezone); } - return CronExpression::factory($this->expression)->isDue($date->toDateTimeString()); + return (new CronExpression($this->expression))->isDue($date->toDateTimeString()); } /** @@ -890,9 +890,8 @@ public function getSummaryForDisplay() */ public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false) { - return Date::instance(CronExpression::factory( - $this->getExpression() - )->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone)); + return Date::instance((new CronExpression($this->getExpression())) + ->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone)); } /** From e0c638167c5e6911d6fc579bc4e04b66f6a94784 Mon Sep 17 00:00:00 2001 From: Roy de Vos Burchart Date: Mon, 15 Mar 2021 14:43:13 +0100 Subject: [PATCH 26/41] Remove null from return in phpdoc (#36593) --- src/Illuminate/Support/Stringable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/Stringable.php b/src/Illuminate/Support/Stringable.php index 0d544a3987cf..d834260e11cf 100644 --- a/src/Illuminate/Support/Stringable.php +++ b/src/Illuminate/Support/Stringable.php @@ -335,7 +335,7 @@ public function markdown(array $options = []) * Get the string matching the given pattern. * * @param string $pattern - * @return static|null + * @return static */ public function match($pattern) { From c67a685598de8e12e7fcf03095ac168f85122c4e Mon Sep 17 00:00:00 2001 From: Nguyen You Date: Mon, 15 Mar 2021 20:43:55 +0700 Subject: [PATCH 27/41] Update docblock (#36592) --- src/Illuminate/Foundation/Console/stubs/view-component.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Console/stubs/view-component.stub b/src/Illuminate/Foundation/Console/stubs/view-component.stub index 5c6ecc586ec4..22eae518c1a4 100644 --- a/src/Illuminate/Foundation/Console/stubs/view-component.stub +++ b/src/Illuminate/Foundation/Console/stubs/view-component.stub @@ -19,7 +19,7 @@ class DummyClass extends Component /** * Get the view / contents that represent the component. * - * @return \Illuminate\Contracts\View\View|string + * @return \Illuminate\Contracts\View\View|\Closure|string */ public function render() { From 1e09138398ff1a6a9812e58041f1f9f31d846846 Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 15 Mar 2021 14:48:31 +0100 Subject: [PATCH 28/41] Stack driver fix: respect the defined processors (#36591) This update fixes the issue: https://github.com/laravel/ideas/issues/1735 --- src/Illuminate/Log/LogManager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Log/LogManager.php b/src/Illuminate/Log/LogManager.php index 0e0abcd67c33..ed6c418abc2d 100644 --- a/src/Illuminate/Log/LogManager.php +++ b/src/Illuminate/Log/LogManager.php @@ -244,12 +244,16 @@ protected function createStackDriver(array $config) $handlers = collect($config['channels'])->flatMap(function ($channel) { return $this->channel($channel)->getHandlers(); })->all(); + + $processors = collect($config['channels'])->flatMap(function ($channel) { + return $this->channel($channel)->getProcessors(); + })->all(); if ($config['ignore_exceptions'] ?? false) { $handlers = [new WhatFailureGroupHandler($handlers)]; } - return new Monolog($this->parseChannel($config), $handlers); + return new Monolog($this->parseChannel($config), $handlers, $processors); } /** From c02e3250c3a933b08656ac4c84168353eba771a8 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 15 Mar 2021 08:48:56 -0500 Subject: [PATCH 29/41] Apply fixes from StyleCI (#36603) --- src/Illuminate/Log/LogManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Log/LogManager.php b/src/Illuminate/Log/LogManager.php index ed6c418abc2d..f5d0ac486e2b 100644 --- a/src/Illuminate/Log/LogManager.php +++ b/src/Illuminate/Log/LogManager.php @@ -244,7 +244,7 @@ protected function createStackDriver(array $config) $handlers = collect($config['channels'])->flatMap(function ($channel) { return $this->channel($channel)->getHandlers(); })->all(); - + $processors = collect($config['channels'])->flatMap(function ($channel) { return $this->channel($channel)->getProcessors(); })->all(); From 580fb32724e9dfbeade884dcd91721f4f47b44b5 Mon Sep 17 00:00:00 2001 From: Matthew Boynes Date: Mon, 15 Mar 2021 19:03:48 -0400 Subject: [PATCH 30/41] Require the correct password to rehash it --- src/Illuminate/Auth/SessionGuard.php | 24 ++++++++++++++++--- tests/Integration/Auth/AuthenticationTest.php | 17 ++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index 1f6863141c4c..1748e9af19fb 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -573,6 +573,26 @@ protected function cycleRememberToken(AuthenticatableContract $user) $this->provider->updateRememberToken($user, $token); } + /** + * Rehash the user's password. + * + * @param string $password + * @param string $attribute + * @return bool|null + * + * @throws AuthenticationException If the password is invalid. + */ + protected function rehashUserPassword($password, $attribute) + { + if (! Hash::check($password, $this->user()->$attribute)) { + throw new AuthenticationException('Password mismatch.'); + } + + return tap($this->user()->forceFill([ + $attribute => Hash::make($password), + ]))->save(); + } + /** * Invalidate other sessions for the current user. * @@ -588,9 +608,7 @@ public function logoutOtherDevices($password, $attribute = 'password') return; } - $result = tap($this->user()->forceFill([ - $attribute => Hash::make($password), - ]))->save(); + $result = $this->rehashUserPassword($password, $attribute); if ($this->recaller() || $this->getCookieJar()->hasQueued($this->getRecallerName())) { diff --git a/tests/Integration/Auth/AuthenticationTest.php b/tests/Integration/Auth/AuthenticationTest.php index ec23afba3d18..23862f48d94a 100644 --- a/tests/Integration/Auth/AuthenticationTest.php +++ b/tests/Integration/Auth/AuthenticationTest.php @@ -2,6 +2,7 @@ namespace Illuminate\Tests\Integration\Auth; +use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\EloquentUserProvider; use Illuminate\Auth\Events\Attempting; use Illuminate\Auth\Events\Authenticated; @@ -211,7 +212,7 @@ public function testLoggingOutOtherDevices() $this->assertEquals(1, $user->id); - $this->app['auth']->logoutOtherDevices('adifferentpassword'); + $this->app['auth']->logoutOtherDevices('password'); $this->assertEquals(1, $user->id); Event::assertDispatched(OtherDeviceLogout::class, function ($event) { @@ -222,6 +223,20 @@ public function testLoggingOutOtherDevices() }); } + public function testPasswordMustBeValidToLogOutOtherDevices() + { + $this->expectException(AuthenticationException::class); + $this->expectExceptionMessage('Password mismatch.'); + + $this->app['auth']->loginUsingId(1); + + $user = $this->app['auth']->user(); + + $this->assertEquals(1, $user->id); + + $this->app['auth']->logoutOtherDevices('adifferentpassword'); + } + public function testLoggingInOutViaAttemptRemembering() { $this->assertTrue( From ef4541d51a805eb711e14af897515aa7b2ed3569 Mon Sep 17 00:00:00 2001 From: Matthew Boynes Date: Mon, 15 Mar 2021 19:18:55 -0400 Subject: [PATCH 31/41] Add @throws to logoutOtherDevices() --- src/Illuminate/Auth/SessionGuard.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index 1748e9af19fb..ef7ab4ebecc1 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -601,6 +601,8 @@ protected function rehashUserPassword($password, $attribute) * @param string $password * @param string $attribute * @return bool|null + * + * @throws AuthenticationException If the password is invalid. */ public function logoutOtherDevices($password, $attribute = 'password') { From ceb2f46592007ca63bea9836d5547b38c8c47711 Mon Sep 17 00:00:00 2001 From: Matthew Boynes Date: Mon, 15 Mar 2021 21:14:42 -0400 Subject: [PATCH 32/41] Clarify that the current user's password is rehashing --- src/Illuminate/Auth/SessionGuard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index ef7ab4ebecc1..bc6bad4d6a14 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -574,7 +574,7 @@ protected function cycleRememberToken(AuthenticatableContract $user) } /** - * Rehash the user's password. + * Rehash the current user's password. * * @param string $password * @param string $attribute From 7aabd8f0a8f8e0a3420359f807f42ceacb5c4140 Mon Sep 17 00:00:00 2001 From: Matthew Boynes Date: Tue, 16 Mar 2021 07:50:38 -0400 Subject: [PATCH 33/41] Use FQN in docblock, remove description --- src/Illuminate/Auth/SessionGuard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index bc6bad4d6a14..74569a7bf599 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -580,7 +580,7 @@ protected function cycleRememberToken(AuthenticatableContract $user) * @param string $attribute * @return bool|null * - * @throws AuthenticationException If the password is invalid. + * @throws \Illuminate\Auth\AuthenticationException */ protected function rehashUserPassword($password, $attribute) { @@ -602,7 +602,7 @@ protected function rehashUserPassword($password, $attribute) * @param string $attribute * @return bool|null * - * @throws AuthenticationException If the password is invalid. + * @throws \Illuminate\Auth\AuthenticationException */ public function logoutOtherDevices($password, $attribute = 'password') { From d98cf8b5baca2d12341cdc1d75888cfe6fb67260 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij <45041769+jnoordsij@users.noreply.github.com> Date: Tue, 16 Mar 2021 13:43:20 +0100 Subject: [PATCH 34/41] [8.x] Use different config key for overriding temporary url host in AwsTemporaryUrl method (#36612) * Use different config key for overriding temporary url host * Update FilesystemAdapter.php Co-authored-by: Taylor Otwell --- src/Illuminate/Filesystem/FilesystemAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 5d6de6ed3321..935c413cd6c0 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -601,7 +601,7 @@ public function getAwsTemporaryUrl($adapter, $path, $expiration, $options) // If an explicit base URL has been set on the disk configuration then we will use // it as the base URL instead of the default path. This allows the developer to // have full control over the base path for this filesystem's generated URLs. - if (! is_null($url = $this->driver->getConfig()->get('url'))) { + if (! is_null($url = $this->driver->getConfig()->get('temporary_url'))) { $uri = $this->replaceBaseUrl($uri, $url); } From 1e6161250074b8106c1fcf153eeaef7c0bf74c6c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 16 Mar 2021 09:14:59 -0500 Subject: [PATCH 35/41] formatting --- src/Illuminate/Auth/SessionGuard.php | 41 ++++++++++--------- tests/Integration/Auth/AuthenticationTest.php | 6 +-- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index 74569a7bf599..48d64c47d39f 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -20,6 +20,7 @@ use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; +use InvalidArgumentException; use RuntimeException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; @@ -573,26 +574,6 @@ protected function cycleRememberToken(AuthenticatableContract $user) $this->provider->updateRememberToken($user, $token); } - /** - * Rehash the current user's password. - * - * @param string $password - * @param string $attribute - * @return bool|null - * - * @throws \Illuminate\Auth\AuthenticationException - */ - protected function rehashUserPassword($password, $attribute) - { - if (! Hash::check($password, $this->user()->$attribute)) { - throw new AuthenticationException('Password mismatch.'); - } - - return tap($this->user()->forceFill([ - $attribute => Hash::make($password), - ]))->save(); - } - /** * Invalidate other sessions for the current user. * @@ -622,6 +603,26 @@ public function logoutOtherDevices($password, $attribute = 'password') return $result; } + /** + * Rehash the current user's password. + * + * @param string $password + * @param string $attribute + * @return bool|null + * + * @throws \InvalidArgumentException + */ + protected function rehashUserPassword($password, $attribute) + { + if (! Hash::check($password, $this->user()->{$attribute})) { + throw new InvalidArgumentException("The given password does not match the current password."); + } + + return tap($this->user()->forceFill([ + $attribute => Hash::make($password), + ]))->save(); + } + /** * Register an authentication attempt event listener. * diff --git a/tests/Integration/Auth/AuthenticationTest.php b/tests/Integration/Auth/AuthenticationTest.php index 23862f48d94a..e2ec79050d18 100644 --- a/tests/Integration/Auth/AuthenticationTest.php +++ b/tests/Integration/Auth/AuthenticationTest.php @@ -2,7 +2,6 @@ namespace Illuminate\Tests\Integration\Auth; -use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\EloquentUserProvider; use Illuminate\Auth\Events\Attempting; use Illuminate\Auth\Events\Authenticated; @@ -20,6 +19,7 @@ use Illuminate\Support\Str; use Illuminate\Support\Testing\Fakes\EventFake; use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser; +use InvalidArgumentException; use Orchestra\Testbench\TestCase; /** @@ -225,8 +225,8 @@ public function testLoggingOutOtherDevices() public function testPasswordMustBeValidToLogOutOtherDevices() { - $this->expectException(AuthenticationException::class); - $this->expectExceptionMessage('Password mismatch.'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('current password'); $this->app['auth']->loginUsingId(1); From ebfa75fee5acef028a09f52a78a7069b1a09a723 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 16 Mar 2021 09:15:38 -0500 Subject: [PATCH 36/41] Apply fixes from StyleCI (#36615) --- src/Illuminate/Auth/SessionGuard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index 48d64c47d39f..4bb3fd4b6f73 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -615,7 +615,7 @@ public function logoutOtherDevices($password, $attribute = 'password') protected function rehashUserPassword($password, $attribute) { if (! Hash::check($password, $this->user()->{$attribute})) { - throw new InvalidArgumentException("The given password does not match the current password."); + throw new InvalidArgumentException('The given password does not match the current password.'); } return tap($this->user()->forceFill([ From c25308a00c7bbd38401a6254ab403146da9cfd69 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 16 Mar 2021 09:18:55 -0500 Subject: [PATCH 37/41] version --- src/Illuminate/Foundation/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 1f46747dbfbd..5fa3b2bed350 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -31,7 +31,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '6.20.18'; + const VERSION = '6.20.19'; /** * The base path for the Laravel installation. From acb117738ddb28ea7fc6a2029cf1d0d06c4b2b57 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Tue, 16 Mar 2021 19:05:22 +0200 Subject: [PATCH 38/41] [8.x] Add DB::resetRecordsModifications (#36617) * add DB::resetRecordsModifications * Update Connection.php Co-authored-by: Taylor Otwell --- src/Illuminate/Database/Connection.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php index b4fa6d4c3a0d..b2ded4c9aebb 100755 --- a/src/Illuminate/Database/Connection.php +++ b/src/Illuminate/Database/Connection.php @@ -867,6 +867,16 @@ public function recordsHaveBeenModified($value = true) } } + /** + * Reset the record modification state. + * + * @return void + */ + public function forgetRecordModificationState() + { + $this->recordsModified = false; + } + /** * Is Doctrine available? * From 9f986cef11b959679f530eb24d929b39a2690924 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 16 Mar 2021 19:40:07 +0200 Subject: [PATCH 39/41] [8.x] update changelog --- CHANGELOG-8.x.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md index e5ca8f3668f8..399b85419411 100644 --- a/CHANGELOG-8.x.md +++ b/CHANGELOG-8.x.md @@ -1,6 +1,26 @@ # Release Notes for 8.x -## [Unreleased](https://github.com/laravel/framework/compare/v8.32.1...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.33.0...8.x) + + +## [v8.33.0 (2021-03-16)](https://github.com/laravel/framework/compare/v8.32.1...v8.33.0) + +### Added +- Added broken pipe exception as lost connection error ([#36601](https://github.com/laravel/framework/pull/36601)) +- Added missing option to resource ([#36562](https://github.com/laravel/framework/pull/36562)) +- Introduce StringEncrypter interface ([#36578](https://github.com/laravel/framework/pull/36578)) + +### Fixed +- Fixed returns with Mail & Notification components ([#36559](https://github.com/laravel/framework/pull/36559)) +- Stack driver fix: respect the defined processors in LogManager ([#36591](https://github.com/laravel/framework/pull/36591)) +- Require the correct password to rehash it when logging out other devices ([#36608](https://github.com/laravel/framework/pull/36608), [1e61612](https://github.com/laravel/framework/commit/1e6161250074b8106c1fcf153eeaef7c0bf74c6c)) + +### Changed +- Allow nullable columns for `AsArrayObject/AsCollection` casts ([#36526](https://github.com/laravel/framework/pull/36526)) +- Accept callable class for reportable and renderable in exception handler ([#36551](https://github.com/laravel/framework/pull/36551)) +- Container - detect circular dependencies ([dd7274d](https://github.com/laravel/framework/commit/dd7274d23a9ee58cc1abdf7107403169a3994b68), [a712f72](https://github.com/laravel/framework/commit/a712f72ca88f709335576530b31635738abd4c89), [6f9bb4c](https://github.com/laravel/framework/commit/6f9bb4cdd84295cbcf7908cc4b4684f47f38b8cf)) +- Initialize CronExpression class using new keyword ([#36600](https://github.com/laravel/framework/pull/36600)) +- Use different config key for overriding temporary url host in AwsTemporaryUrl method ([#36612](https://github.com/laravel/framework/pull/36612)) ## [v8.32.1 (2021-03-09)](https://github.com/laravel/framework/compare/v8.32.0...v8.32.1) From 332844e5bde34f8db91aeca4d21cd4e0925d691e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 16 Mar 2021 14:42:13 -0500 Subject: [PATCH 40/41] revert circular dep --- src/Illuminate/Container/Container.php | 6 +++--- tests/Container/ContainerTest.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index 4ea378983d0d..642d1e082e6d 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -842,9 +842,9 @@ public function build($concrete) return $this->notInstantiable($concrete); } - if (in_array($concrete, $this->buildStack)) { - throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); - } + // if (in_array($concrete, $this->buildStack)) { + // throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); + // } $this->buildStack[] = $concrete; diff --git a/tests/Container/ContainerTest.php b/tests/Container/ContainerTest.php index 39638694f802..eefe9366cbfc 100755 --- a/tests/Container/ContainerTest.php +++ b/tests/Container/ContainerTest.php @@ -564,13 +564,13 @@ public function testContainerCanResolveClasses() $this->assertInstanceOf(ContainerConcreteStub::class, $class); } - public function testContainerCanCatchCircularDependency() - { - $this->expectException(CircularDependencyException::class); + // public function testContainerCanCatchCircularDependency() + // { + // $this->expectException(CircularDependencyException::class); - $container = new Container; - $container->get(CircularAStub::class); - } + // $container = new Container; + // $container->get(CircularAStub::class); + // } } class CircularAStub From 354c57b8cb457549114074c500944455a288d6cc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 16 Mar 2021 14:42:32 -0500 Subject: [PATCH 41/41] patch --- src/Illuminate/Foundation/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 840265edce7b..cbd1cba90c73 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -33,7 +33,7 @@ class Application extends Container implements ApplicationContract, CachesConfig * * @var string */ - const VERSION = '8.33.0'; + const VERSION = '8.33.1'; /** * The base path for the Laravel installation.