From d94c07d72c14f07e7d2027458e7f0a76f9ceb0d9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 13 Apr 2021 08:49:28 -0500 Subject: [PATCH 01/30] 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 34bbb83f924a..9e37bd61811d 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.22'; + const VERSION = '6.20.23'; /** * The base path for the Laravel installation. From f04d1aa72ec15ffa7d9291e1b1e4603819e364c8 Mon Sep 17 00:00:00 2001 From: Karel Faille Date: Wed, 14 Apr 2021 13:46:55 +0200 Subject: [PATCH 02/30] Rename actingAs $guard parameter (#36982) --- .../Concerns/InteractsWithAuthentication.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php index 404a8bfb628d..9e8c0f5870b6 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php @@ -10,30 +10,30 @@ trait InteractsWithAuthentication * Set the currently logged in user for the application. * * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string|null $driver + * @param string|null $guard * @return $this */ - public function actingAs(UserContract $user, $driver = null) + public function actingAs(UserContract $user, $guard = null) { - return $this->be($user, $driver); + return $this->be($user, $guard); } /** * Set the currently logged in user for the application. * * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string|null $driver + * @param string|null $guard * @return $this */ - public function be(UserContract $user, $driver = null) + public function be(UserContract $user, $guard = null) { if (isset($user->wasRecentlyCreated) && $user->wasRecentlyCreated) { $user->wasRecentlyCreated = false; } - $this->app['auth']->guard($driver)->setUser($user); + $this->app['auth']->guard($guard)->setUser($user); - $this->app['auth']->shouldUse($driver); + $this->app['auth']->shouldUse($guard); return $this; } From dbc1a191c4a02c2a3d47eeeacb9898ceff54b930 Mon Sep 17 00:00:00 2001 From: celaraze <31471452+celaraze@users.noreply.github.com> Date: Wed, 14 Apr 2021 19:47:14 +0800 Subject: [PATCH 03/30] Update Schema.php (#36981) Add `getColumnListing()` annotation. It's more friendly for IDE. --- src/Illuminate/Support/Facades/Schema.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Support/Facades/Schema.php b/src/Illuminate/Support/Facades/Schema.php index 8c5b32c21ead..896e1764cd83 100755 --- a/src/Illuminate/Support/Facades/Schema.php +++ b/src/Illuminate/Support/Facades/Schema.php @@ -18,6 +18,7 @@ * @method static bool hasTable(string $table) * @method static void defaultStringLength(int $length) * @method static void registerCustomDoctrineType(string $class, string $name, string $type) + * @method static array getColumnListing(string $table) * * @see \Illuminate\Database\Schema\Builder */ From a106b939e9bce2ddd7325e1cf2c539d9afa4966a Mon Sep 17 00:00:00 2001 From: rochdiNassah Date: Wed, 14 Apr 2021 11:48:08 +0000 Subject: [PATCH 04/30] [8.x] Fixed typos and formatting (#36979) * Typo & Format * Update HasAttributes.php Co-authored-by: Taylor Otwell --- src/Illuminate/Collections/Traits/EnumeratesValues.php | 4 ++-- .../Database/Eloquent/Concerns/HasAttributes.php | 2 +- src/Illuminate/Database/Events/MigrationEvent.php | 2 +- src/Illuminate/Database/Schema/Grammars/Grammar.php | 4 ++-- src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php | 4 ++-- .../Database/Schema/Grammars/PostgresGrammar.php | 4 ++-- .../Database/Schema/Grammars/SqlServerGrammar.php | 4 ++-- src/Illuminate/Database/Schema/MySqlBuilder.php | 4 ++-- src/Illuminate/Database/Schema/PostgresBuilder.php | 4 ++-- src/Illuminate/Database/Schema/SQLiteBuilder.php | 4 ++-- src/Illuminate/Database/Schema/SqlServerBuilder.php | 4 ++-- src/Illuminate/Support/Str.php | 6 +++--- src/Illuminate/Support/Stringable.php | 6 +++--- src/Illuminate/Testing/Concerns/TestDatabases.php | 8 ++++---- src/Illuminate/Testing/ParallelRunner.php | 2 +- src/Illuminate/Testing/ParallelTesting.php | 4 ++-- tests/Queue/QueueBeanstalkdQueueTest.php | 6 +++--- tests/Validation/ValidationValidatorTest.php | 6 +++--- 18 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Illuminate/Collections/Traits/EnumeratesValues.php b/src/Illuminate/Collections/Traits/EnumeratesValues.php index 865d0047cdd5..bdeb7fde8a48 100644 --- a/src/Illuminate/Collections/Traits/EnumeratesValues.php +++ b/src/Illuminate/Collections/Traits/EnumeratesValues.php @@ -730,7 +730,7 @@ public function tap(callable $callback) * Reduce the collection to a single value. * * @param callable $callback - * @param mixed $initial + * @param mixed $initial * @return mixed */ public function reduce(callable $callback, $initial = null) @@ -748,7 +748,7 @@ public function reduce(callable $callback, $initial = null) * Reduce an associative collection to a single value. * * @param callable $callback - * @param mixed $initial + * @param mixed $initial * @return mixed */ public function reduceWithKeys(callable $callback, $initial = null) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php index 7d660905e393..af89e47e0a28 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php @@ -695,7 +695,7 @@ public function setAttribute($key, $value) { // First we will check for the presence of a mutator for the set operation // which simply lets the developers tweak the attribute as it is set on - // the model, such as "json_encoding" an listing of data for storage. + // this model, such as "json_encoding" a listing of data for storage. if ($this->hasSetMutator($key)) { return $this->setMutatedAttributeValue($key, $value); } diff --git a/src/Illuminate/Database/Events/MigrationEvent.php b/src/Illuminate/Database/Events/MigrationEvent.php index 53b91a56b372..157303d2e2b5 100644 --- a/src/Illuminate/Database/Events/MigrationEvent.php +++ b/src/Illuminate/Database/Events/MigrationEvent.php @@ -8,7 +8,7 @@ abstract class MigrationEvent implements MigrationEventContract { /** - * An migration instance. + * A migration instance. * * @var \Illuminate\Database\Migrations\Migration */ diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index 18071b2fbb12..2ca54eecf504 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -31,7 +31,7 @@ abstract class Grammar extends BaseGrammar /** * Compile a create database command. * - * @param string $name + * @param string $name * @param \Illuminate\Database\Connection $connection * @return string */ @@ -43,7 +43,7 @@ public function compileCreateDatabase($name, $connection) /** * Compile a drop database if exists command. * - * @param string $name + * @param string $name * @return string */ public function compileDropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php index 37df3337b040..b6e4e3568d8e 100755 --- a/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php @@ -29,7 +29,7 @@ class MySqlGrammar extends Grammar /** * Compile a create database command. * - * @param string $name + * @param string $name * @param \Illuminate\Database\Connection $connection * @return string */ @@ -46,7 +46,7 @@ public function compileCreateDatabase($name, $connection) /** * Compile a drop database if exists command. * - * @param string $name + * @param string $name * @return string */ public function compileDropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index fb7005b09df3..133da288f19d 100755 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -38,7 +38,7 @@ class PostgresGrammar extends Grammar /** * Compile a create database command. * - * @param string $name + * @param string $name * @param \Illuminate\Database\Connection $connection * @return string */ @@ -54,7 +54,7 @@ public function compileCreateDatabase($name, $connection) /** * Compile a drop database if exists command. * - * @param string $name + * @param string $name * @return string */ public function compileDropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php index b147628ec2f3..bc6d6d43102e 100755 --- a/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php @@ -31,7 +31,7 @@ class SqlServerGrammar extends Grammar /** * Compile a create database command. * - * @param string $name + * @param string $name * @param \Illuminate\Database\Connection $connection * @return string */ @@ -46,7 +46,7 @@ public function compileCreateDatabase($name, $connection) /** * Compile a drop database if exists command. * - * @param string $name + * @param string $name * @return string */ public function compileDropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/MySqlBuilder.php b/src/Illuminate/Database/Schema/MySqlBuilder.php index b7cff5568d1b..699b41d5f227 100755 --- a/src/Illuminate/Database/Schema/MySqlBuilder.php +++ b/src/Illuminate/Database/Schema/MySqlBuilder.php @@ -7,7 +7,7 @@ class MySqlBuilder extends Builder /** * Create a database in the schema. * - * @param string $name + * @param string $name * @return bool */ public function createDatabase($name) @@ -20,7 +20,7 @@ public function createDatabase($name) /** * Drop a database from the schema if the database exists. * - * @param string $name + * @param string $name * @return bool */ public function dropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/PostgresBuilder.php b/src/Illuminate/Database/Schema/PostgresBuilder.php index 82702a802691..ce1b5770ad5a 100755 --- a/src/Illuminate/Database/Schema/PostgresBuilder.php +++ b/src/Illuminate/Database/Schema/PostgresBuilder.php @@ -7,7 +7,7 @@ class PostgresBuilder extends Builder /** * Create a database in the schema. * - * @param string $name + * @param string $name * @return bool */ public function createDatabase($name) @@ -20,7 +20,7 @@ public function createDatabase($name) /** * Drop a database from the schema if the database exists. * - * @param string $name + * @param string $name * @return bool */ public function dropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/SQLiteBuilder.php b/src/Illuminate/Database/Schema/SQLiteBuilder.php index 6a1dbae23ec6..3bc1275c6e04 100644 --- a/src/Illuminate/Database/Schema/SQLiteBuilder.php +++ b/src/Illuminate/Database/Schema/SQLiteBuilder.php @@ -9,7 +9,7 @@ class SQLiteBuilder extends Builder /** * Create a database in the schema. * - * @param string $name + * @param string $name * @return bool */ public function createDatabase($name) @@ -20,7 +20,7 @@ public function createDatabase($name) /** * Drop a database from the schema if the database exists. * - * @param string $name + * @param string $name * @return bool */ public function dropDatabaseIfExists($name) diff --git a/src/Illuminate/Database/Schema/SqlServerBuilder.php b/src/Illuminate/Database/Schema/SqlServerBuilder.php index 223abd44ed1c..93da1cb86fad 100644 --- a/src/Illuminate/Database/Schema/SqlServerBuilder.php +++ b/src/Illuminate/Database/Schema/SqlServerBuilder.php @@ -7,7 +7,7 @@ class SqlServerBuilder extends Builder /** * Create a database in the schema. * - * @param string $name + * @param string $name * @return bool */ public function createDatabase($name) @@ -20,7 +20,7 @@ public function createDatabase($name) /** * Drop a database from the schema if the database exists. * - * @param string $name + * @param string $name * @return bool */ public function dropDatabaseIfExists($name) diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index db2656483e70..1e6b849cc8a9 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -573,9 +573,9 @@ public static function replaceLast($search, $replace, $subject) /** * Remove any occurrence of the given string in the subject. * - * @param string|array $search - * @param string $subject - * @param bool $caseSensitive + * @param string|array $search + * @param string $subject + * @param bool $caseSensitive * @return string */ public static function remove($search, $subject, $caseSensitive = true) diff --git a/src/Illuminate/Support/Stringable.php b/src/Illuminate/Support/Stringable.php index 5085a3b876c1..79d5a9160215 100644 --- a/src/Illuminate/Support/Stringable.php +++ b/src/Illuminate/Support/Stringable.php @@ -426,7 +426,7 @@ public function parseCallback($default = null) /** * Call the given callback and return a new string. * - * @param callable $callback + * @param callable $callback * @return static */ public function pipe(callable $callback) @@ -470,8 +470,8 @@ public function prepend(...$values) /** * Remove any occurrence of the given string in the subject. * - * @param string|array $search - * @param bool $caseSensitive + * @param string|array $search + * @param bool $caseSensitive * @return static */ public function remove($search, $caseSensitive = true) diff --git a/src/Illuminate/Testing/Concerns/TestDatabases.php b/src/Illuminate/Testing/Concerns/TestDatabases.php index 9e3198a0f166..f554f6d26be4 100644 --- a/src/Illuminate/Testing/Concerns/TestDatabases.php +++ b/src/Illuminate/Testing/Concerns/TestDatabases.php @@ -107,8 +107,8 @@ protected function ensureSchemaIsUpToDate() /** * Runs the given callable using the given database. * - * @param string $database - * @param callable $callable + * @param string $database + * @param callable $callable * @return void */ protected function usingDatabase($database, $callable) @@ -126,7 +126,7 @@ protected function usingDatabase($database, $callable) /** * Apply the given callback when tests are not using in memory database. * - * @param callable $callback + * @param callable $callback * @return void */ protected function whenNotUsingInMemoryDatabase($callback) @@ -141,7 +141,7 @@ protected function whenNotUsingInMemoryDatabase($callback) /** * Switch to the given database. * - * @param string $database + * @param string $database * @return void */ protected function switchToDatabase($database) diff --git a/src/Illuminate/Testing/ParallelRunner.php b/src/Illuminate/Testing/ParallelRunner.php index 802fe22ca30d..4d226a5643b7 100644 --- a/src/Illuminate/Testing/ParallelRunner.php +++ b/src/Illuminate/Testing/ParallelRunner.php @@ -106,7 +106,7 @@ public function getExitCode(): int /** * Apply the given callback for each process. * - * @param callable $callback + * @param callable $callback * @return void */ protected function forEachProcess($callback) diff --git a/src/Illuminate/Testing/ParallelTesting.php b/src/Illuminate/Testing/ParallelTesting.php index 11ebcfa89ed6..a3f7fc7e203a 100644 --- a/src/Illuminate/Testing/ParallelTesting.php +++ b/src/Illuminate/Testing/ParallelTesting.php @@ -238,7 +238,7 @@ public function callTearDownTestCaseCallbacks($testCase) } /** - * Get an parallel testing option. + * Get a parallel testing option. * * @param string $option * @return mixed @@ -269,7 +269,7 @@ public function token() /** * Apply the callback if tests are running in parallel. * - * @param callable $callback + * @param callable $callback * @return void */ protected function whenRunningInParallel($callback) diff --git a/tests/Queue/QueueBeanstalkdQueueTest.php b/tests/Queue/QueueBeanstalkdQueueTest.php index 534a16141381..87a779f638ef 100755 --- a/tests/Queue/QueueBeanstalkdQueueTest.php +++ b/tests/Queue/QueueBeanstalkdQueueTest.php @@ -112,9 +112,9 @@ public function testDeleteProperlyRemoveJobsOffBeanstalkd() } /** - * @param string $default - * @param int $timeToRun - * @param int $blockFor + * @param string $default + * @param int $timeToRun + * @param int $blockFor */ private function setQueue($default, $timeToRun, $blockFor = 0) { diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index d1d3d424dd59..d0f99e3bd705 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -1998,9 +1998,9 @@ public function testValidateMax() } /** - * @param mixed $input - * @param mixed $allowed - * @param bool $passes + * @param mixed $input + * @param mixed $allowed + * @param bool $passes * * @dataProvider multipleOfDataProvider */ From 15b6358cc285365970b6e9bd9d44e7f9b739db6d Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Wed, 14 Apr 2021 13:58:24 +0200 Subject: [PATCH 05/30] Revert "Revert "[6.x] Fix required_if boolean validation"" (#36969) --- .../Validation/Concerns/ValidatesAttributes.php | 13 ++++++++++++- tests/Validation/ValidationValidatorTest.php | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 13fe1a648108..68b38aa8491c 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -1475,13 +1475,24 @@ protected function prepareValuesAndOther($parameters) $values = array_slice($parameters, 1); - if (is_bool($other)) { + if ($this->shouldConvertToBoolean($parameters[0]) || is_bool($other)) { $values = $this->convertValuesToBoolean($values); } return [$values, $other]; } + /** + * Check if parameter should be converted to boolean. + * + * @param string $parameter + * @return bool + */ + protected function shouldConvertToBoolean($parameter) + { + return in_array('boolean', Arr::get($this->rules, $parameter, [])); + } + /** * Convert the given values to boolean if they are string "true" / "false". * diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index 4ac71213c984..2938f18e92b0 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -1090,6 +1090,17 @@ public function testRequiredIf() $v = new Validator($trans, ['first' => 'dayle', 'last' => ''], ['last' => 'RequiredIf:first,taylor,dayle']); $this->assertFalse($v->passes()); $this->assertSame('The last field is required when first is dayle.', $v->messages()->first('last')); + + $trans = $this->getIlluminateArrayTranslator(); + $trans->addLines(['validation.required_if' => 'The :attribute field is required when :other is :value.'], 'en'); + $v = new Validator($trans, ['foo' => 0], [ + 'foo' => 'required|boolean', + 'bar' => 'required_if:foo,true', + 'baz' => 'required_if:foo,false', + ]); + $this->assertTrue($v->fails()); + $this->assertCount(1, $v->messages()); + $this->assertSame('The baz field is required when foo is 0.', $v->messages()->first('baz')); } public function testRequiredUnless() From 591bb23a3c5fed0d89a5638a54c3d99df0554650 Mon Sep 17 00:00:00 2001 From: Jeroen van Rensen <46967616+jeroenvanrensen@users.noreply.github.com> Date: Wed, 14 Apr 2021 21:33:59 +0200 Subject: [PATCH 06/30] [8.x] Add a wordCount() string helper (#36990) * Add a wordCount() string helper * Update Str.php * Update Stringable.php Co-authored-by: Taylor Otwell --- src/Illuminate/Support/Str.php | 11 +++++++++++ src/Illuminate/Support/Stringable.php | 10 ++++++++++ tests/Support/SupportStrTest.php | 6 ++++++ tests/Support/SupportStringableTest.php | 6 ++++++ 4 files changed, 33 insertions(+) diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index 1e6b849cc8a9..37e3fd082956 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -766,6 +766,17 @@ public static function ucfirst($string) return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); } + /** + * Get the number of words a string contains. + * + * @param string $string + * @return int + */ + public static function wordCount($string) + { + return str_word_count($string); + } + /** * Generate a UUID (version 4). * diff --git a/src/Illuminate/Support/Stringable.php b/src/Illuminate/Support/Stringable.php index 79d5a9160215..290914bc32a1 100644 --- a/src/Illuminate/Support/Stringable.php +++ b/src/Illuminate/Support/Stringable.php @@ -756,6 +756,16 @@ public function words($words = 100, $end = '...') return new static(Str::words($this->value, $words, $end)); } + /** + * Get the number of words a string contains. + * + * @return int + */ + public function wordCount() + { + return str_word_count($this->value); + } + /** * Dump the string. * diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index f120708968dc..d8c744b37c70 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -494,6 +494,12 @@ public function testPadRight() $this->assertSame('Alien ', Str::padRight('Alien', 10)); } + public function testWordCount() + { + $this->assertEquals(2, Str::wordCount('Hello, world!')); + $this->assertEquals(10, Str::wordCount('Hi, this is my first contribution to the Laravel framework.')); + } + public function validUuidList() { return [ diff --git a/tests/Support/SupportStringableTest.php b/tests/Support/SupportStringableTest.php index be88413d750a..70916a0458b9 100644 --- a/tests/Support/SupportStringableTest.php +++ b/tests/Support/SupportStringableTest.php @@ -608,4 +608,10 @@ public function testRepeat() $this->assertSame('aaaaa', (string) $this->stringable('a')->repeat(5)); $this->assertSame('', (string) $this->stringable('')->repeat(5)); } + + public function testWordCount() + { + $this->assertEquals(2, $this->stringable('Hello, world!')->wordCount()); + $this->assertEquals(10, $this->stringable('Hi, this is my first contribution to the Laravel framework.')->wordCount()); + } } From f1b3e80d22e57b28f9afbd7e44529c6b15b39526 Mon Sep 17 00:00:00 2001 From: netpok Date: Wed, 14 Apr 2021 21:34:24 +0200 Subject: [PATCH 07/30] Simplify throw unless (#36988) --- src/Illuminate/Support/helpers.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 85486f6bbc55..0500f009bf60 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -304,13 +304,7 @@ function throw_if($condition, $exception = 'RuntimeException', ...$parameters) */ function throw_unless($condition, $exception = 'RuntimeException', ...$parameters) { - if (! $condition) { - if (is_string($exception) && class_exists($exception)) { - $exception = new $exception(...$parameters); - } - - throw is_string($exception) ? new RuntimeException($exception) : $exception; - } + throw_if(! $condition, $exception, ...$parameters); return $condition; } From 626cd9b2536236a779e8f0014c7976550cb0a58c Mon Sep 17 00:00:00 2001 From: netpok Date: Wed, 14 Apr 2021 21:34:43 +0200 Subject: [PATCH 08/30] Fix docblock (#36987) --- src/Illuminate/Support/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 0500f009bf60..f54c233ab561 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -272,7 +272,7 @@ function tap($value, $callback = null) * * @param mixed $condition * @param \Throwable|string $exception - * @param array ...$parameters + * @param mixed ...$parameters * @return mixed * * @throws \Throwable @@ -297,7 +297,7 @@ function throw_if($condition, $exception = 'RuntimeException', ...$parameters) * * @param mixed $condition * @param \Throwable|string $exception - * @param array ...$parameters + * @param mixed ...$parameters * @return mixed * * @throws \Throwable From ca73c513d95bbf8b6fd6975a25d040416f5abd4d Mon Sep 17 00:00:00 2001 From: Lasse Mettovaara Date: Thu, 15 Apr 2021 14:51:39 +0300 Subject: [PATCH 09/30] [8.x] Update HTTP client docblocks (#36999) * Update Factory.php * Update Pool.php * Update Http.php --- src/Illuminate/Http/Client/Factory.php | 2 +- src/Illuminate/Http/Client/Pool.php | 3 +++ src/Illuminate/Support/Facades/Http.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Http/Client/Factory.php b/src/Illuminate/Http/Client/Factory.php index 6fc069d390b7..200f7f5e7a90 100644 --- a/src/Illuminate/Http/Client/Factory.php +++ b/src/Illuminate/Http/Client/Factory.php @@ -35,7 +35,7 @@ * @method \Illuminate\Http\Client\PendingRequest dump() * @method \Illuminate\Http\Client\PendingRequest dd() * @method \Illuminate\Http\Client\PendingRequest async() - * @method \Illuminate\Http\Client\Pool pool() + * @method \Illuminate\Http\Client\Pool pool(callable $callback) * @method \Illuminate\Http\Client\Response delete(string $url, array $data = []) * @method \Illuminate\Http\Client\Response get(string $url, array $query = []) * @method \Illuminate\Http\Client\Response head(string $url, array $query = []) diff --git a/src/Illuminate/Http/Client/Pool.php b/src/Illuminate/Http/Client/Pool.php index 15002b28e92e..23ae75e9b158 100644 --- a/src/Illuminate/Http/Client/Pool.php +++ b/src/Illuminate/Http/Client/Pool.php @@ -2,6 +2,9 @@ namespace Illuminate\Http\Client; +/** + * @mixin \Illuminate\Http\Client\Factory + */ class Pool { /** diff --git a/src/Illuminate/Support/Facades/Http.php b/src/Illuminate/Support/Facades/Http.php index 51763b6caef0..8d48496c03f7 100644 --- a/src/Illuminate/Support/Facades/Http.php +++ b/src/Illuminate/Support/Facades/Http.php @@ -33,7 +33,7 @@ * @method static \Illuminate\Http\Client\PendingRequest dump() * @method static \Illuminate\Http\Client\PendingRequest dd() * @method static \Illuminate\Http\Client\PendingRequest async() - * @method static \Illuminate\Http\Client\Pool pool() + * @method static \Illuminate\Http\Client\Pool pool(callable $callback) * @method static \Illuminate\Http\Client\Response delete(string $url, array $data = []) * @method static \Illuminate\Http\Client\Response get(string $url, array $query = []) * @method static \Illuminate\Http\Client\Response head(string $url, array $query = []) From d5cb1d5af670e3d5b6beb2aa0f91a207d2501c6d Mon Sep 17 00:00:00 2001 From: James Brooks Date: Thu, 15 Apr 2021 12:53:14 +0100 Subject: [PATCH 10/30] Correctly merge object payload data (#36998) --- src/Illuminate/Queue/Queue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Queue/Queue.php b/src/Illuminate/Queue/Queue.php index 52bd32e924e8..e6285008fc98 100755 --- a/src/Illuminate/Queue/Queue.php +++ b/src/Illuminate/Queue/Queue.php @@ -157,10 +157,10 @@ protected function createObjectPayload($job, $queue) : serialize(clone $job); return array_merge($payload, [ - 'data' => [ + 'data' => array_merge($payload['data'], [ 'commandName' => get_class($job), 'command' => $command, - ], + ]), ]); } From 22003eb868698660ea9faad8a9501939a3345030 Mon Sep 17 00:00:00 2001 From: netpok Date: Thu, 15 Apr 2021 13:56:35 +0200 Subject: [PATCH 11/30] [8.x] Use stdClass as placeholder (#36996) * Use stdClass as placeholder * Update Validator.php Co-authored-by: Taylor Otwell --- src/Illuminate/Validation/Validator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index 2311b7357718..70b8c17a6f3d 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -13,6 +13,7 @@ use Illuminate\Support\MessageBag; use Illuminate\Support\Str; use RuntimeException; +use stdClass; use Symfony\Component\HttpFoundation\File\UploadedFile; class Validator implements ValidatorContract @@ -503,7 +504,7 @@ public function validated() $results = []; - $missingValue = Str::random(10); + $missingValue = new stdClass; foreach (array_keys($this->getRules()) as $key) { $value = data_get($this->getData(), $key, $missingValue); From 9f455b717933cdb777e53c1a10bffbf62d67e643 Mon Sep 17 00:00:00 2001 From: Oliver Matla Date: Thu, 15 Apr 2021 13:58:12 +0200 Subject: [PATCH 12/30] fix deprecation warning in PHP 8.1 if $line is null. (#36992) --- src/Illuminate/Notifications/Messages/SimpleMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/Messages/SimpleMessage.php b/src/Illuminate/Notifications/Messages/SimpleMessage.php index f90b26e9986b..1d48117b1e51 100644 --- a/src/Illuminate/Notifications/Messages/SimpleMessage.php +++ b/src/Illuminate/Notifications/Messages/SimpleMessage.php @@ -192,7 +192,7 @@ protected function formatLine($line) return implode(' ', array_map('trim', $line)); } - return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line)))); + return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line ?? '')))); } /** From 74e7b29c6d8ab46439bbd53a774c910b1f5ef88d Mon Sep 17 00:00:00 2001 From: Oliver Matla Date: Thu, 15 Apr 2021 13:58:25 +0200 Subject: [PATCH 13/30] fix deprecation warning for PHP 8.1 if actionUrl is null. (#36991) --- src/Illuminate/Notifications/Messages/SimpleMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/Messages/SimpleMessage.php b/src/Illuminate/Notifications/Messages/SimpleMessage.php index 1d48117b1e51..e532aa4bf4ae 100644 --- a/src/Illuminate/Notifications/Messages/SimpleMessage.php +++ b/src/Illuminate/Notifications/Messages/SimpleMessage.php @@ -239,7 +239,7 @@ public function toArray() 'outroLines' => $this->outroLines, 'actionText' => $this->actionText, 'actionUrl' => $this->actionUrl, - 'displayableActionUrl' => str_replace(['mailto:', 'tel:'], '', $this->actionUrl), + 'displayableActionUrl' => str_replace(['mailto:', 'tel:'], '', $this->actionUrl ?? ''), ]; } } From 6116d5106525a05d885408ed0a63a752732ba253 Mon Sep 17 00:00:00 2001 From: netpok Date: Thu, 15 Apr 2021 13:59:24 +0200 Subject: [PATCH 14/30] Use value helper when applicable (#36994) --- .../Database/Eloquent/Concerns/HidesAttributes.php | 8 ++------ .../Foundation/Testing/Concerns/InteractsWithViews.php | 7 +------ src/Illuminate/Foundation/helpers.php | 2 +- src/Illuminate/View/Concerns/ManagesComponents.php | 8 ++------ 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php index 7f6ebfdbc55f..065d48a8d0ff 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HidesAttributes.php @@ -94,9 +94,7 @@ public function makeVisible($attributes) */ public function makeVisibleIf($condition, $attributes) { - $condition = $condition instanceof Closure ? $condition($this) : $condition; - - return $condition ? $this->makeVisible($attributes) : $this; + return value($condition, $this) ? $this->makeVisible($attributes) : $this; } /** @@ -123,8 +121,6 @@ public function makeHidden($attributes) */ public function makeHiddenIf($condition, $attributes) { - $condition = $condition instanceof Closure ? $condition($this) : $condition; - - return value($condition) ? $this->makeHidden($attributes) : $this; + return value($condition, $this) ? $this->makeHidden($attributes) : $this; } } diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php index faa6c64a367e..9dfbff5a38d2 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php @@ -2,7 +2,6 @@ namespace Illuminate\Foundation\Testing\Concerns; -use Closure; use Illuminate\Support\Facades\View as ViewFacade; use Illuminate\Support\MessageBag; use Illuminate\Support\Str; @@ -57,11 +56,7 @@ protected function component(string $componentClass, array $data = []) { $component = $this->app->make($componentClass, $data); - $view = $component->resolveView(); - - if ($view instanceof Closure) { - $view = $view($data); - } + $view = value($component->resolveView(), $data); return $view instanceof View ? new TestView($view->with($component->data())) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 7aa2228e187c..5f5a71168701 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -659,7 +659,7 @@ function rescue(callable $callback, $rescue = null, $report = true) report($e); } - return $rescue instanceof Closure ? $rescue($e) : $rescue; + return value($rescue, $e); } } } diff --git a/src/Illuminate/View/Concerns/ManagesComponents.php b/src/Illuminate/View/Concerns/ManagesComponents.php index 81b2bdf6cbaf..273e8b496328 100644 --- a/src/Illuminate/View/Concerns/ManagesComponents.php +++ b/src/Illuminate/View/Concerns/ManagesComponents.php @@ -2,7 +2,6 @@ namespace Illuminate\View\Concerns; -use Closure; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\View\View; use Illuminate\Support\Arr; @@ -84,9 +83,7 @@ public function renderComponent() $data = $this->componentData(); - if ($view instanceof Closure) { - $view = $view($data); - } + $view = value($view, $data); if ($view instanceof View) { return $view->with($data)->render(); @@ -151,8 +148,7 @@ public function endSlot() $this->slotStack[$this->currentComponent()] ); - $this->slots[$this->currentComponent()] - [$currentSlot] = new HtmlString(trim(ob_get_clean())); + $this->slots[$this->currentComponent()][$currentSlot] = new HtmlString(trim(ob_get_clean())); } /** From f6721f0be85db8a2112f3e2d94e9875484c3f422 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Thu, 15 Apr 2021 13:49:53 +0100 Subject: [PATCH 15/30] [8.x] Add test case for #36998 (#37003) * Add test case for #36998 * Apply fixes from StyleCI (#37002) --- tests/Queue/QueueSyncQueueTest.php | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/Queue/QueueSyncQueueTest.php b/tests/Queue/QueueSyncQueueTest.php index 2064add943a8..d4d07bbb2d6a 100755 --- a/tests/Queue/QueueSyncQueueTest.php +++ b/tests/Queue/QueueSyncQueueTest.php @@ -6,8 +6,11 @@ use Illuminate\Container\Container; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Queue\QueueableEntity; +use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\Jobs\SyncJob; use Illuminate\Queue\SyncQueue; +use LogicException; use Mockery as m; use PHPUnit\Framework\TestCase; @@ -54,6 +57,26 @@ public function testFailedJobGetsHandledWhenAnExceptionIsThrown() Container::setInstance(); } + + public function testCreatesPayloadObject() + { + $sync = new SyncQueue; + $container = new Container; + $container->bind(\Illuminate\Contracts\Events\Dispatcher::class, \Illuminate\Events\Dispatcher::class); + $container->bind(\Illuminate\Contracts\Bus\Dispatcher::class, \Illuminate\Bus\Dispatcher::class); + $container->bind(\Illuminate\Contracts\Container\Container::class, \Illuminate\Container\Container::class); + $sync->setContainer($container); + + SyncQueue::createPayloadUsing(function ($connection, $queue, $payload) { + return ['data' => ['extra' => 'extraValue']]; + }); + + try { + $sync->push(new SyncQueueJob()); + } catch (LogicException $e) { + $this->assertEquals('extraValue', $e->getMessage()); + } + } } class SyncQueueTestEntity implements QueueableEntity @@ -94,3 +117,20 @@ public function failed() $_SERVER['__sync.failed'] = true; } } + +class SyncQueueJob implements ShouldQueue +{ + use InteractsWithQueue; + + public function handle() + { + throw new LogicException($this->getValueFromJob('extra')); + } + + public function getValueFromJob($key) + { + $payload = $this->job->payload(); + + return $payload['data'][$key] ?? null; + } +} From 8d16ccc10817e2715249ee6d2f44b94a1ba72668 Mon Sep 17 00:00:00 2001 From: netpok Date: Thu, 15 Apr 2021 21:57:41 +0200 Subject: [PATCH 16/30] [8.x] Allow anonymous and class based migration coexisting (#37006) * Update test to fail * Validate file path --- src/Illuminate/Database/Migrations/Migrator.php | 2 +- tests/Integration/Migration/MigratorTest.php | 2 +- .../fixtures/2015_10_04_000000_modify_people_table.php | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Database/Migrations/Migrator.php b/src/Illuminate/Database/Migrations/Migrator.php index 35b4bb92e92a..c204e1764314 100755 --- a/src/Illuminate/Database/Migrations/Migrator.php +++ b/src/Illuminate/Database/Migrations/Migrator.php @@ -470,7 +470,7 @@ protected function resolvePath(string $path) { $class = $this->getMigrationClass($this->getMigrationName($path)); - if (class_exists($class)) { + if (class_exists($class) && realpath($path) == (new ReflectionClass($class))->getFileName()) { return new $class; } diff --git a/tests/Integration/Migration/MigratorTest.php b/tests/Integration/Migration/MigratorTest.php index 08dd9c97862f..e21a884e4152 100644 --- a/tests/Integration/Migration/MigratorTest.php +++ b/tests/Integration/Migration/MigratorTest.php @@ -76,7 +76,7 @@ public function testPretendMigrate() { $this->expectOutput('CreatePeopleTable: create table "people" ("id" integer not null primary key autoincrement, "name" varchar not null, "email" varchar not null, "password" varchar not null, "remember_token" varchar, "created_at" datetime, "updated_at" datetime)'); $this->expectOutput('CreatePeopleTable: create unique index "people_email_unique" on "people" ("email")'); - $this->expectOutput('2015_10_04_000000_modify_people_table: alter table "people" add column "first_name" varchar'); + $this->expectOutput('ModifyPeopleTable: alter table "people" add column "first_name" varchar'); $this->expectOutput('2016_10_04_000000_modify_people_table: alter table "people" add column "last_name" varchar'); $this->subject->run([__DIR__.'/fixtures'], ['pretend' => true]); diff --git a/tests/Integration/Migration/fixtures/2015_10_04_000000_modify_people_table.php b/tests/Integration/Migration/fixtures/2015_10_04_000000_modify_people_table.php index 88ac706cd12a..c6a827583761 100644 --- a/tests/Integration/Migration/fixtures/2015_10_04_000000_modify_people_table.php +++ b/tests/Integration/Migration/fixtures/2015_10_04_000000_modify_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +class ModifyPeopleTable extends Migration +{ /** * Run the migrations. * @@ -28,4 +29,4 @@ public function down() $table->dropColumn('first_name'); }); } -}; +} From a5f4cfab0cc3f44951f73aa4faf8457beae3e759 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Thu, 15 Apr 2021 23:42:28 +0300 Subject: [PATCH 17/30] [8.x] update changelog --- CHANGELOG-8.x.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md index 5656104410a4..d17f2624e978 100644 --- a/CHANGELOG-8.x.md +++ b/CHANGELOG-8.x.md @@ -1,6 +1,16 @@ # Release Notes for 8.x -## [Unreleased](https://github.com/laravel/framework/compare/v8.36.0...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.36.1...8.x) + + +## [v8.36.1 (2021-04-07)](https://github.com/laravel/framework/compare/v8.36.0...v8.36.1) + +### Fixed +- Fixed escaping within quoted strings in blade ([#36893](https://github.com/laravel/framework/pull/36893)) + +### Changed +- Call transaction callbacks after updating the transaction level ([#36890](https://github.com/laravel/framework/pull/36890), [#36892](https://github.com/laravel/framework/pull/36892)) +- Support maxExceptions option on queued listeners ([#36891](https://github.com/laravel/framework/pull/36891)) ## [v8.36.0 (2021-04-06)](https://github.com/laravel/framework/compare/v8.35.1...v8.36.0) From 034b485075cddd0d5f8ae3c310e53f997028239e Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Thu, 15 Apr 2021 23:46:57 +0300 Subject: [PATCH 18/30] [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 d17f2624e978..ef2f430b3eb5 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.36.1...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.36.2...8.x) + + +## [v8.36.1 (2021-04-07)](https://github.com/laravel/framework/compare/v8.36.1...v8.36.2) + +### Revert +- Revert blade changes ([#36902](https://github.com/laravel/framework/pull/36902)) ## [v8.36.1 (2021-04-07)](https://github.com/laravel/framework/compare/v8.36.0...v8.36.1) From 5531a599e15ff3c3acc0affa18e3824242b52ba3 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Thu, 15 Apr 2021 23:51:22 +0300 Subject: [PATCH 19/30] [6.x] update changelog --- CHANGELOG-6.x.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index c88ba87c7212..614783adc58f 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,11 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.22...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.23...6.x) + + +## [v6.20.23 (2021-04-13)](https://github.com/laravel/framework/compare/v6.20.22...v6.20.23) + +### Added strings to the `DetectsLostConnections.php` ([4210258](https://github.com/laravel/framework/commit/42102589bc7f7b8533ee1b815ef0cc18017d4e45)) ## [v6.20.22 (2021-03-31)](https://github.com/laravel/framework/compare/v6.20.21...v6.20.22) From 402ca919344c25c67b487a12e4a8b6edb0cdfc57 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Thu, 15 Apr 2021 23:51:45 +0300 Subject: [PATCH 20/30] [6.x] update changelog --- CHANGELOG-6.x.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 614783adc58f..0a43e37ec935 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -5,7 +5,8 @@ ## [v6.20.23 (2021-04-13)](https://github.com/laravel/framework/compare/v6.20.22...v6.20.23) -### Added strings to the `DetectsLostConnections.php` ([4210258](https://github.com/laravel/framework/commit/42102589bc7f7b8533ee1b815ef0cc18017d4e45)) +### Added +- Added strings to the `DetectsLostConnections.php` ([4210258](https://github.com/laravel/framework/commit/42102589bc7f7b8533ee1b815ef0cc18017d4e45)) ## [v6.20.22 (2021-03-31)](https://github.com/laravel/framework/compare/v6.20.21...v6.20.22) From 37ba32dc5f52d261b482815d194fba1476b725a2 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Thu, 15 Apr 2021 23:54:53 +0300 Subject: [PATCH 21/30] [8.x] update changelog --- CHANGELOG-8.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md index ef2f430b3eb5..d5b540e498ce 100644 --- a/CHANGELOG-8.x.md +++ b/CHANGELOG-8.x.md @@ -3,7 +3,7 @@ ## [Unreleased](https://github.com/laravel/framework/compare/v8.36.2...8.x) -## [v8.36.1 (2021-04-07)](https://github.com/laravel/framework/compare/v8.36.1...v8.36.2) +## [v8.36.2 (2021-04-07)](https://github.com/laravel/framework/compare/v8.36.1...v8.36.2) ### Revert - Revert blade changes ([#36902](https://github.com/laravel/framework/pull/36902)) From 02fd52f65491e45a768068e3a6c731fdf2d35ac1 Mon Sep 17 00:00:00 2001 From: Can Vural Date: Sat, 17 Apr 2021 19:53:05 +0200 Subject: [PATCH 22/30] Update SoftDeletes docblock (#37022) --- src/Illuminate/Database/Eloquent/SoftDeletes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/SoftDeletes.php b/src/Illuminate/Database/Eloquent/SoftDeletes.php index 3f7a00e0090d..f9739698000a 100644 --- a/src/Illuminate/Database/Eloquent/SoftDeletes.php +++ b/src/Illuminate/Database/Eloquent/SoftDeletes.php @@ -3,9 +3,10 @@ namespace Illuminate\Database\Eloquent; /** - * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withTrashed() + * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withTrashed(bool $withTrashed = true) * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder onlyTrashed() * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withoutTrashed() + * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder restore() */ trait SoftDeletes { From 100ed71fe11a25908539c57368a048ec80c6123d Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Sun, 18 Apr 2021 22:34:49 +0300 Subject: [PATCH 23/30] [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 d5b540e498ce..7b9707cef486 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.36.2...8.x) +## [Unreleased](https://github.com/laravel/framework/compare/v8.37.0...8.x) + + +## [v8.37.0 (2021-04-13)](https://github.com/laravel/framework/compare/v8.36.2...v8.37.0) + +### Added +- Allow to retry jobs by queue name ([#36898](https://github.com/laravel/framework/pull/36898), [f2d9b59](https://github.com/laravel/framework/commit/f2d9b595e51d564c5e1390eb42438c632e0daf36), [c351a30](https://github.com/laravel/framework/commit/c351a309f1a02098f9a7ee24a8a402e9ce06fead)) +- Added strings to the `DetectsLostConnections.php` ([4210258](https://github.com/laravel/framework/commit/42102589bc7f7b8533ee1b815ef0cc18017d4e45)) +- Allow testing of Blade components that return closures ([#36919](https://github.com/laravel/framework/pull/36919)) +- Added anonymous migrations ([#36906](https://github.com/laravel/framework/pull/36906)) +- Added `Session\Store::missing()` method ([#36937](https://github.com/laravel/framework/pull/36937)) +- Handle concurrent asynchronous requests in the HTTP client ([#36948](https://github.com/laravel/framework/pull/36948), [245a712](https://github.com/laravel/framework/commit/245a7125076e52da7ce55b494c1c01f0f28df55d)) +- Added tinyText data type to Blueprint and to available database grammars ([#36949](https://github.com/laravel/framework/pull/36949)) +- Added a method to remove a resolved view engine ([#36955](https://github.com/laravel/framework/pull/36955)) +- Added `Illuminate\Database\Eloquent\Model::getAttributesForInsert()` protected method ([9a9f59f](https://github.com/laravel/framework/commit/9a9f59fcc6e7b93465ce9848b52a473477dff64a), [314bf87](https://github.com/laravel/framework/commit/314bf875ba5d37c056ccea5148181fcb0517f596)) + +### Fixed +- Fixed clone() on EloquentBuilder ([#36924](https://github.com/laravel/framework/pull/36924)) + +### Changed +- `Model::delete()` throw LogicException not Exception ([#36914](https://github.com/laravel/framework/pull/36914)) +- Make pagination linkCollection() method public ([#36959](https://github.com/laravel/framework/pull/36959)) ## [v8.36.2 (2021-04-07)](https://github.com/laravel/framework/compare/v8.36.1...v8.36.2) From 5b6b9f3bcedd0d2d23f8af76554bcc9bad763edf Mon Sep 17 00:00:00 2001 From: Slava Abakumov Date: Sun, 18 Apr 2021 23:23:32 +0300 Subject: [PATCH 24/30] Typo fix in Bus::hasFinallyCallbacks() docblock --- src/Illuminate/Bus/Batch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Bus/Batch.php b/src/Illuminate/Bus/Batch.php index cac16e1e9f51..58c453d872da 100644 --- a/src/Illuminate/Bus/Batch.php +++ b/src/Illuminate/Bus/Batch.php @@ -368,7 +368,7 @@ public function hasCatchCallbacks() } /** - * Determine if the batch has "then" callbacks. + * Determine if the batch has "finally" callbacks. * * @return bool */ From aa1f47e644fb6a1fabee47f318227b41001e31e1 Mon Sep 17 00:00:00 2001 From: Victor Dauchy <26772554+vdauchy@users.noreply.github.com> Date: Mon, 19 Apr 2021 08:29:33 -0400 Subject: [PATCH 25/30] Add setPusher() to PusherBroadcaster::class (#37033) --- .../Broadcasting/Broadcasters/PusherBroadcaster.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php b/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php index 15695e114e6f..2b486becd363 100644 --- a/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php +++ b/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php @@ -160,4 +160,15 @@ public function getPusher() { return $this->pusher; } + + /** + * Set the Pusher SDK instance. + * + * @param \Pusher\Pusher $pusher + * @return void + */ + public function setPusher($pusher) + { + $this->pusher = $pusher; + } } From 856cdbaf55b4304da0389b3ce33044f4b105e0fe Mon Sep 17 00:00:00 2001 From: Jesper Noordsij <45041769+jnoordsij@users.noreply.github.com> Date: Mon, 19 Apr 2021 15:26:42 +0200 Subject: [PATCH 26/30] [8.x] Allow the use of temporary views for Blade testing on Windows machines (#37044) * Allow the use of temporary views for Blade testing on Windows machines * Fix StyleCI issue * Add first test for InteractsWithViews trait * Fix StyleCI issues * Update InteractsWithViews.php Co-authored-by: Taylor Otwell --- .../Testing/Concerns/InteractsWithViews.php | 7 ++++--- .../Concerns/InteractsWithViewsTest.php | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 tests/Foundation/Testing/Concerns/InteractsWithViewsTest.php diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php index 9dfbff5a38d2..574effe21260 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithViews.php @@ -4,7 +4,6 @@ use Illuminate\Support\Facades\View as ViewFacade; use Illuminate\Support\MessageBag; -use Illuminate\Support\Str; use Illuminate\Support\ViewErrorBag; use Illuminate\Testing\TestView; use Illuminate\View\View; @@ -38,11 +37,13 @@ protected function blade(string $template, array $data = []) ViewFacade::addLocation(sys_get_temp_dir()); } - $tempFile = tempnam($tempDirectory, 'laravel-blade').'.blade.php'; + $tempFileInfo = pathinfo(tempnam($tempDirectory, 'laravel-blade')); + + $tempFile = $tempFileInfo['dirname'].'/'.$tempFileInfo['filename'].'.blade.php'; file_put_contents($tempFile, $template); - return new TestView(view(Str::before(basename($tempFile), '.blade.php'), $data)); + return new TestView(view($tempFileInfo['filename'], $data)); } /** diff --git a/tests/Foundation/Testing/Concerns/InteractsWithViewsTest.php b/tests/Foundation/Testing/Concerns/InteractsWithViewsTest.php new file mode 100644 index 000000000000..42bc6c2ec28d --- /dev/null +++ b/tests/Foundation/Testing/Concerns/InteractsWithViewsTest.php @@ -0,0 +1,18 @@ +blade('@if(true)test @endif'); + + $this->assertEquals('test ', $string); + } +} From 57c283c18dec3524cb1a607e71c99e7242c46771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20Deleu?= Date: Tue, 20 Apr 2021 14:39:05 +0200 Subject: [PATCH 27/30] [8.x] Fix Http::withBody() not being sent (#37057) * Send pending body with the request * StyleCI --- src/Illuminate/Http/Client/PendingRequest.php | 2 ++ tests/Http/HttpClientTest.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index f0790c5a54a3..f7723243e917 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -642,6 +642,8 @@ public function send(string $method, string $url, array $options = []) $options[$this->bodyFormat], $this->pendingFiles ); } + } else { + $options[$this->bodyFormat] = $this->pendingBody; } [$this->pendingBody, $this->pendingFiles] = [null, []]; diff --git a/tests/Http/HttpClientTest.php b/tests/Http/HttpClientTest.php index 84709fa3ba66..a6637134708a 100644 --- a/tests/Http/HttpClientTest.php +++ b/tests/Http/HttpClientTest.php @@ -76,6 +76,21 @@ public function testResponseCanBeReturnedAsCollection() $this->assertEquals(collect(), $response->collect('missing_key')); } + public function testSendRequestBody() + { + $body = '{"test":"phpunit"}'; + + $fakeRequest = function (Request $request) use ($body) { + self::assertSame($body, $request->body()); + + return ['my' => 'response']; + }; + + $this->factory->fake($fakeRequest); + + $this->factory->withBody($body, 'application/json')->send('get', 'http://foo.com/api'); + } + public function testUrlsCanBeStubbedByPath() { $this->factory->fake([ From fb186696daadeeacc83432273a67176ee033aac9 Mon Sep 17 00:00:00 2001 From: "motoki.ito" <50390672+motoki-ito@users.noreply.github.com> Date: Tue, 20 Apr 2021 21:42:40 +0900 Subject: [PATCH 28/30] Fix InteractsWithFlashData.php return types null in DocBlocks (#37053) --- src/Illuminate/Http/Concerns/InteractsWithFlashData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Concerns/InteractsWithFlashData.php b/src/Illuminate/Http/Concerns/InteractsWithFlashData.php index 25e11a95438f..6682e5427273 100644 --- a/src/Illuminate/Http/Concerns/InteractsWithFlashData.php +++ b/src/Illuminate/Http/Concerns/InteractsWithFlashData.php @@ -9,7 +9,7 @@ trait InteractsWithFlashData * * @param string|null $key * @param string|array|null $default - * @return string|array + * @return string|array|null */ public function old($key = null, $default = null) { From addc44fce390c783b2dee0d617300dce97e895f4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Apr 2021 08:46:19 -0500 Subject: [PATCH 29/30] 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 9e37bd61811d..477a7f05c0f2 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.23'; + const VERSION = '6.20.24'; /** * The base path for the Laravel installation. From 553af8267cd74697b7c5a0aca3dc80213a302bde Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Apr 2021 08:49:57 -0500 Subject: [PATCH 30/30] 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 b9a9eecbbca9..c8df0b9d3236 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.37.0'; + const VERSION = '8.38.0'; /** * The base path for the Laravel installation. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy