From cdf0359c15768821ea35aa31da5b51654529b41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Wed, 30 Aug 2017 09:03:45 -0700 Subject: [PATCH 01/66] tag v5.5.0 release notes --- CHANGELOG-5.5.md | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/CHANGELOG-5.5.md b/CHANGELOG-5.5.md index 458f21c5fa32..172897d96aeb 100644 --- a/CHANGELOG-5.5.md +++ b/CHANGELOG-5.5.md @@ -1,27 +1,14 @@ # Release Notes for 5.5.x -## [Unreleased] +## v5.5.0 (2017-08-30) ### General - ⚠️ Require PHP 7+ ([06907a0](https://github.com/laravel/framework/pull/17048/commits/06907a055e3d28c219f6b6ab97902f0be3e8a4ef), [39809ce](https://github.com/laravel/framework/pull/17048/commits/39809cea81a5564d196c16a87cbc25de88dd3d1c)) - ⚠️ Removed deprecated `ServiceProvider::compile()` method ([10da428](https://github.com/laravel/framework/pull/17048/commits/10da428eb344191608474f1c12ee7edb0290e80a)) - ⚠️ Removed deprecated `Str::quickRandom()` method ([2ef257a](https://github.com/laravel/framework/pull/17048/commits/2ef257a4197b7e6efeb0d6ac4a3958f82b7fed39)) - Removed `build` scripts ([7c16b15](https://github.com/laravel/framework/pull/17048/commits/7c16b154ede10ff9a37756e32d7dddf317524634)) -- Support callable/invokable objects in `Pipeline` ([#18264](https://github.com/laravel/framework/pull/18264)) -- Support for `Responsable` objects ([c0c89fd](https://github.com/laravel/framework/commit/c0c89fd73cebf9ed56e6c5e69ad35106df03d9db), [1229b7f](https://github.com/laravel/framework/commit/1229b7f45d3f574d7e0262cc2d5aec80ccbb1626), [#19614](https://github.com/laravel/framework/pull/19614), [ef0e37d](https://github.com/laravel/framework/commit/ef0e37d44182ac5043b5459bb25b1861e8e036df)) -- ⚠️ Prevent access to protected properties using array access on `Model` and `Fluent` ([#18403](https://github.com/laravel/framework/pull/18403)) -- ⚠️ Extend `MessageBag` interface from `Arrayable` and add `getMessages()` method ([#19768](https://github.com/laravel/framework/pull/19768), [#20334](https://github.com/laravel/framework/pull/20334)) -- Handle `Arrayable` items in `MessageBag` ([6f1f4d8](https://github.com/laravel/framework/commit/6f1f4d834a2f985a06d956305fc73b5329363071)) -- Added `isNotEmpty()` method to message bags and paginators ([#19944](https://github.com/laravel/framework/pull/19944)) -- Return the collection iterator from `AbstractPaginator::getIterator()` ([#20098](https://github.com/laravel/framework/pull/20098)) -- Throw `RuntimeException` when app key is missing ([#19145](https://github.com/laravel/framework/pull/19145), [8adbaa7](https://github.com/laravel/framework/commit/8adbaa714d37bb7214f29b12c52354900a1c6dc5)) -- Autoload package providers ([#19420](https://github.com/laravel/framework/pull/19420), [a5a0f3e](https://github.com/laravel/framework/commit/a5a0f3e7b82a1a4dc00037c5463a31d42c94903a), [2954091](https://github.com/laravel/framework/commit/295409189af589c6389d01e9d55f5568741149ee), [#19455](https://github.com/laravel/framework/pull/19455), [#19561](https://github.com/laravel/framework/pull/19561), [#19646](https://github.com/laravel/framework/pull/19646)) - Upgraded to Symfony 3.3 components ([4db7031](https://github.com/laravel/framework/commit/4db70311b1b3813359b250d3f5a58743fa436453), [67a5367](https://github.com/laravel/framework/commit/67a536758d1636935ab5502bb6faedd73b30810f)) -- Support registering macros using classes ([#19782](https://github.com/laravel/framework/pull/19782), [353adbd](https://github.com/laravel/framework/commit/353adbd696e36764227e39980272d38147899d14)) -- Made `Carbon` macroable and serializeable ([#19771](https://github.com/laravel/framework/pull/19771), [#20568](https://github.com/laravel/framework/pull/20568), [6a18209](https://github.com/laravel/framework/commit/6a18209863a934446d21ad8bc82c83d4b7dee5e7)) -- ⚠️ Moved `InteractsWithTime` to `Illuminate\Support` ([#20119](https://github.com/laravel/framework/pull/20119), [#20206](https://github.com/laravel/framework/pull/20206)) -- ⚠️ Fixed minimum value of paginator `last_page` field ([#20335](https://github.com/laravel/framework/pull/20335)) -- Added API resources ([#20710](https://github.com/laravel/framework/pull/20710), [2d8b803](https://github.com/laravel/framework/commit/2d8b803e93455db7ce70aed822f62b8d8ad2f4eb), [80a8ca9](https://github.com/laravel/framework/commit/80a8ca9be1b2f86849c07f4705c6660172e54177), [f8db604](https://github.com/laravel/framework/commit/f8db60430d4b811f8ab771d25ec23b1c70edd302), [a07d028](https://github.com/laravel/framework/commit/a07d028d732780249539dc6c33396dafc3bfa173), [88d5f21](https://github.com/laravel/framework/commit/88d5f21fb73b52578be3057b4f373f204955b1c8), [814043e](https://github.com/laravel/framework/commit/814043e30fcf6bf37aa442c09edadd74568ec997), [d64cf19](https://github.com/laravel/framework/commit/d64cf191354ef3a0467c2cd839dfd9feb79b374e), [ec87d74](https://github.com/laravel/framework/commit/ec87d74c7715ac5f32a4d06126b0e226fee3babe), [73de18e](https://github.com/laravel/framework/commit/73de18e32a7d04ed61c1a37b724732a23aad259c)) +- Throw `RuntimeException` when app key is missing ([#19145](https://github.com/laravel/framework/pull/19145), [8adbaa7](https://github.com/laravel/framework/commit/8adbaa714d37bb7214f29b12c52354900a1c6dc5)) ### Artisan Console - Added interactive prompt to `vendor:publish` ([#18230](https://github.com/laravel/framework/pull/18230)) @@ -34,7 +21,6 @@ - ⚠️ Always return array from `RetryCommand::getJobIds()` ([#19232](https://github.com/laravel/framework/pull/19232)) - Support passing absolute paths to `make::listener` ([#19660](https://github.com/laravel/framework/pull/19660)) - ⚠️ Use `handle()` method instead of `fire()` ([#19827](https://github.com/laravel/framework/pull/19827), [#19839](https://github.com/laravel/framework/pull/19839), [#20024](https://github.com/laravel/framework/pull/20024)) -- Removed deprecated `--daemon` option from `queue:work` command ([#19914](https://github.com/laravel/framework/pull/19914)) - Try to guess the `--create` option when generation migrations ([#20032](https://github.com/laravel/framework/pull/20032)) - Generate `make:policy` with real user model namespace ([#20047](https://github.com/laravel/framework/pull/20047)) - Added `Kernel::load()` to auto register a directory of commands ([2e7ddca](https://github.com/laravel/framework/commit/2e7ddca682214ea5ffd21aadc93d33b7a2805e94), [d607b9c](https://github.com/laravel/framework/commit/d607b9c670d9c7f7c749cda0a12a1dc6f55da6e4)) @@ -43,9 +29,10 @@ - Added `CommandStarting` and `CommandFinished` events ([#20298](https://github.com/laravel/framework/pull/20298)) - Show error message if a reverted migration is not found ([#20499](https://github.com/laravel/framework/pull/20499), [a895b1e](https://github.com/laravel/framework/commit/a895b1eb0e50683c4583c24bb17b3f8d9e8127ab)) - Set correct namespace in model factories when using the `app:name` command ([#20766](https://github.com/laravel/framework/pull/20766)) +- ⚠️ Switched the `-f` shortcut from `--force` to `--factory` on `make:model` command ([#20800](https://github.com/laravel/framework/pull/20800)) ### Assets -- Added frontend preset commands (_too many commits, sorry_) +- Added frontend preset commands ([463b769](https://github.com/laravel/framework/commit/463b769270d462468e1b1dcc51a7a1144e003157), _too many follow-up commits_) ### Authentication - ⚠️ Support default user providers and pass user provider to `RequestGuard` ([#18856](https://github.com/laravel/framework/pull/18856)) @@ -105,6 +92,7 @@ - ⚠️ Support sticky database connections ([#20746](https://github.com/laravel/framework/pull/20746)) ### Eloquent ORM +- Added API resources ([#20710](https://github.com/laravel/framework/pull/20710), _too many follow-up commits_) - ⚠️ Indicate soft deleted models as existing ([#17613](https://github.com/laravel/framework/pull/17613)) - ⚠️ Added `$localKey` parameter to `HasRelationships::belongsToMany()` and `BelongsToMany` ([#17903](https://github.com/laravel/framework/pull/17903), [7c7c3bc](https://github.com/laravel/framework/commit/7c7c3bc4be3052afe0889fe323230dfd92f81000)) - ⚠️ Added `$parentKey` parameter to `belongsToMany()`, `BelongsToMany` and `MorphToMany` ([#17915](https://github.com/laravel/framework/pull/17915), [#18380](https://github.com/laravel/framework/pull/18380)) @@ -135,6 +123,7 @@ - ⚠️ Call `setConnection()` in `Model::save()` ([#20466](https://github.com/laravel/framework/pull/20466)) - ⚠️ Touch parent timestamp only if the model is dirty ([#20489](https://github.com/laravel/framework/pull/20489)) - Added `Model::loadMissing()` method ([#20630](https://github.com/laravel/framework/pull/20630), [4166c12](https://github.com/laravel/framework/commit/4166c12492ce7b1112911299caf4cdb17efc9364)) +- Added `Model::whereKeyNot()` method ([#20817](https://github.com/laravel/framework/pull/20817)) ### Encryption - Use `openssl_cipher_iv_length()` in `Encrypter` ([#18684](https://github.com/laravel/framework/pull/18684)) @@ -155,7 +144,7 @@ - Changed how exceptions are logged ([#19698](https://github.com/laravel/framework/pull/19698), [f1971c2](https://github.com/laravel/framework/commit/f1971c2242e4882440162fe504126a1475f7f2b4)) - ⚠️ Return `HttpException` with code `413` from `PostTooLargeException` ([#19773](https://github.com/laravel/framework/pull/19773)) - Support custom logger channel names ([#20133](https://github.com/laravel/framework/pull/20133)) -- ⚠️ Unify exception formatting ([#20173](https://github.com/laravel/framework/pull/20173), [#20067](https://github.com/laravel/framework/pull/20067), [#20167](https://github.com/laravel/framework/pull/20167), [87485e6](https://github.com/laravel/framework/commit/87485e681ca658978f8a131fd0b783ac8c8bab61), [b7e231b](https://github.com/laravel/framework/commit/b7e231b99aecb95a26ec89e5fe73346d4fad7fdc), [5dfe72d](https://github.com/laravel/framework/commit/5dfe72d790ef68cbacd329a351e4706b30422acd), [#20177](https://github.com/laravel/framework/pull/20177), [b3b3eb1](https://github.com/laravel/framework/commit/b3b3eb1b974dd9f126d0ea7c279092c0b050628a)) +- ⚠️ Unify exception formatting ([#20173](https://github.com/laravel/framework/pull/20173), [#20067](https://github.com/laravel/framework/pull/20067), [#20167](https://github.com/laravel/framework/pull/20167), _too many follow-up commits, sorry_) - Added default `Handler::unauthenticated()` method ([11b0de0](https://github.com/laravel/framework/commit/11b0de0485632d5712f7fb59071a4acbc4af2bdc)) ### Events @@ -175,7 +164,7 @@ - Added `$language` parameter to `str_slug()` helper ([#19011](https://github.com/laravel/framework/pull/19011)) - Added `str_before()` helper ([#19940](https://github.com/laravel/framework/pull/19940), [#20049](https://github.com/laravel/framework/pull/20049)) - Added `now()` and `today()` helpers ([3c888b6](https://github.com/laravel/framework/commit/3c888b6c7b89c3d3f90e9024ffbebed3ee80bd23), [#20716](https://github.com/laravel/framework/pull/20716)) -- Added `blank()`, `optional()`, `present()` and `transform()` helpers ([06de9b2](https://github.com/laravel/framework/commit/06de9b2beb9e3c13758d93cee86a1657545cb435)) +- Added `blank()`, `filled()`, `optional()` and `transform()` helpers ([06de9b2](https://github.com/laravel/framework/commit/06de9b2beb9e3c13758d93cee86a1657545cb435), [31308e3](https://github.com/laravel/framework/commit/31308e396ecbfeb5a6e505c50a6b1a6b721b094d)) - Handle lower case words better in as `Str::snake()` ([#18764](https://github.com/laravel/framework/pull/18764)) - Removed usages of the `with()` helper ([#17888](https://github.com/laravel/framework/pull/17888)) - Support multiple patterns in `Str::is()` ([#20108](https://github.com/laravel/framework/pull/20108)) @@ -201,7 +190,7 @@ - Accept other types on `SlackAttachment::timestamp()` ([#20671](https://github.com/laravel/framework/pull/20671)) ### Queues -- Added support for chainable jobs ([81bcb03](https://github.com/laravel/framework/commit/81bcb03b303707cdc94420983b9d72ed558a2b3d), [94c01b1](https://github.com/laravel/framework/commit/94c01b1f37bfbb8e0d5f133b7dd34040b2bdc065), [91f5357](https://github.com/laravel/framework/commit/91f535704d4f6cff5e8393825dbdf46965234fa3), [434245f](https://github.com/laravel/framework/commit/434245f73e694f90476437da8554b58d54ced25c), [b880ad1](https://github.com/laravel/framework/commit/b880ad19282db768718cfd1629ebbc41054daadc), [6af6c8d](https://github.com/laravel/framework/commit/6af6c8d386424b9064ecc1b1bde7a6a9a1bf81b3)) +- Added support for chainable jobs ([81bcb03](https://github.com/laravel/framework/commit/81bcb03b303707cdc94420983b9d72ed558a2b3d), _too many follow-up commits, sorry_) - ⚠️ Removed redundant `$queue` parameter from `Queue::createPayload()` ([#17948](https://github.com/laravel/framework/pull/17948)) - Made all `getQueue()` methods `public` ([#18501](https://github.com/laravel/framework/pull/18501)) - Pass connection and queue to `Looping` event ([#19081](https://github.com/laravel/framework/pull/19081)) @@ -271,6 +260,20 @@ - ⚠️ Store the user password hash when logging in ([#19843](https://github.com/laravel/framework/pull/19843)) - ⚠️ Throw `UnauthorizedHttpException` from `failedBasicResponse` ([#20673](https://github.com/laravel/framework/pull/20673)) +### Support +- Autoload package providers ([#19420](https://github.com/laravel/framework/pull/19420), [a5a0f3e](https://github.com/laravel/framework/commit/a5a0f3e7b82a1a4dc00037c5463a31d42c94903a), [2954091](https://github.com/laravel/framework/commit/295409189af589c6389d01e9d55f5568741149ee), [#19455](https://github.com/laravel/framework/pull/19455), [#19561](https://github.com/laravel/framework/pull/19561), [#19646](https://github.com/laravel/framework/pull/19646)) +- Added support for `Responsable` objects ([c0c89fd](https://github.com/laravel/framework/commit/c0c89fd73cebf9ed56e6c5e69ad35106df03d9db), [1229b7f](https://github.com/laravel/framework/commit/1229b7f45d3f574d7e0262cc2d5aec80ccbb1626), [#19614](https://github.com/laravel/framework/pull/19614), [ef0e37d](https://github.com/laravel/framework/commit/ef0e37d44182ac5043b5459bb25b1861e8e036df)) +- Made `Carbon` macroable and serializeable ([#19771](https://github.com/laravel/framework/pull/19771), [#20568](https://github.com/laravel/framework/pull/20568), [6a18209](https://github.com/laravel/framework/commit/6a18209863a934446d21ad8bc82c83d4b7dee5e7)) +- Support registering macros using classes ([#19782](https://github.com/laravel/framework/pull/19782), [353adbd](https://github.com/laravel/framework/commit/353adbd696e36764227e39980272d38147899d14)) +- ⚠️ Moved `InteractsWithTime` to `Illuminate\Support` ([#20119](https://github.com/laravel/framework/pull/20119), [#20206](https://github.com/laravel/framework/pull/20206)) +- Support callable/invokable objects in `Pipeline` ([#18264](https://github.com/laravel/framework/pull/18264)) +- ⚠️ Prevent access to protected properties using array access on `Model` and `Fluent` ([#18403](https://github.com/laravel/framework/pull/18403)) +- ⚠️ Extend `MessageBag` interface from `Arrayable` and add `getMessages()` method ([#19768](https://github.com/laravel/framework/pull/19768), [#20334](https://github.com/laravel/framework/pull/20334)) +- Handle `Arrayable` items in `MessageBag` ([6f1f4d8](https://github.com/laravel/framework/commit/6f1f4d834a2f985a06d956305fc73b5329363071)) +- Added `isNotEmpty()` method to message bags and paginators ([#19944](https://github.com/laravel/framework/pull/19944)) +- Return the collection iterator from `AbstractPaginator::getIterator()` ([#20098](https://github.com/laravel/framework/pull/20098)) +- ⚠️ Fixed minimum value of paginator `last_page` field ([#20335](https://github.com/laravel/framework/pull/20335)) + ### Task Scheduling - Fire before callbacks on closure-based scheduling events ([#18861](https://github.com/laravel/framework/pull/18861)) - Run after-callbacks even if a callback event failed ([#19573](https://github.com/laravel/framework/pull/19573)) From 5614967299e68151de060cf1a567a8f218ddc4ff Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 30 Aug 2017 22:05:40 +0100 Subject: [PATCH 02/66] Removed deprecated optimize command (#20851) --- .../Foundation/Console/OptimizeCommand.php | 48 ------------------- .../Providers/ArtisanServiceProvider.php | 14 ------ 2 files changed, 62 deletions(-) delete mode 100644 src/Illuminate/Foundation/Console/OptimizeCommand.php diff --git a/src/Illuminate/Foundation/Console/OptimizeCommand.php b/src/Illuminate/Foundation/Console/OptimizeCommand.php deleted file mode 100644 index db44d97f6230..000000000000 --- a/src/Illuminate/Foundation/Console/OptimizeCommand.php +++ /dev/null @@ -1,48 +0,0 @@ - 'command.migrate.reset', 'MigrateRollback' => 'command.migrate.rollback', 'MigrateStatus' => 'command.migrate.status', - 'Optimize' => 'command.optimize', 'PackageDiscover' => 'command.package.discover', 'Preset' => 'command.preset', 'QueueFailed' => 'command.queue.failed', @@ -561,18 +559,6 @@ protected function registerNotificationMakeCommand() }); } - /** - * Register the command. - * - * @return void - */ - protected function registerOptimizeCommand() - { - $this->app->singleton('command.optimize', function ($app) { - return new OptimizeCommand($app['composer']); - }); - } - /** * Register the command. * From 42654c1426ea4f026ccf74c271be7257ec66bf2d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 30 Aug 2017 22:07:22 +0100 Subject: [PATCH 03/66] Bumped versions for 5.6 (#20849) --- composer.json | 2 +- src/Illuminate/Auth/composer.json | 16 ++++++++-------- src/Illuminate/Broadcasting/composer.json | 10 +++++----- src/Illuminate/Bus/composer.json | 8 ++++---- src/Illuminate/Cache/composer.json | 12 ++++++------ src/Illuminate/Config/composer.json | 6 +++--- src/Illuminate/Console/composer.json | 6 +++--- src/Illuminate/Container/composer.json | 4 ++-- src/Illuminate/Contracts/composer.json | 2 +- src/Illuminate/Cookie/composer.json | 6 +++--- src/Illuminate/Database/composer.json | 16 ++++++++-------- src/Illuminate/Encryption/composer.json | 6 +++--- src/Illuminate/Events/composer.json | 8 ++++---- src/Illuminate/Filesystem/composer.json | 6 +++--- src/Illuminate/Foundation/Application.php | 2 +- src/Illuminate/Hashing/composer.json | 6 +++--- src/Illuminate/Http/composer.json | 6 +++--- src/Illuminate/Log/composer.json | 6 +++--- src/Illuminate/Mail/composer.json | 8 ++++---- src/Illuminate/Notifications/composer.json | 20 ++++++++++---------- src/Illuminate/Pagination/composer.json | 6 +++--- src/Illuminate/Pipeline/composer.json | 6 +++--- src/Illuminate/Queue/composer.json | 16 ++++++++-------- src/Illuminate/Redis/composer.json | 6 +++--- src/Illuminate/Routing/composer.json | 16 ++++++++-------- src/Illuminate/Session/composer.json | 10 +++++----- src/Illuminate/Support/composer.json | 4 ++-- src/Illuminate/Translation/composer.json | 8 ++++---- src/Illuminate/Validation/composer.json | 12 ++++++------ src/Illuminate/View/composer.json | 12 ++++++------ tests/Console/ConsoleApplicationTest.php | 2 +- tests/Support/SupportTestingMailFakeTest.php | 4 ++-- 32 files changed, 129 insertions(+), 129 deletions(-) diff --git a/composer.json b/composer.json index 7c19563649bf..70097aa3b917 100644 --- a/composer.json +++ b/composer.json @@ -102,7 +102,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { diff --git a/src/Illuminate/Auth/composer.json b/src/Illuminate/Auth/composer.json index f3a41d953587..8d7421514691 100644 --- a/src/Illuminate/Auth/composer.json +++ b/src/Illuminate/Auth/composer.json @@ -15,10 +15,10 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/http": "5.5.*", - "illuminate/queue": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/http": "5.6.*", + "illuminate/queue": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -27,13 +27,13 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { - "illuminate/console": "Required to use the auth:clear-resets command (5.5.*).", - "illuminate/queue": "Required to fire login / logout events (5.5.*).", - "illuminate/session": "Required to use the session based guard (5.5.*)." + "illuminate/console": "Required to use the auth:clear-resets command (5.6.*).", + "illuminate/queue": "Required to fire login / logout events (5.6.*).", + "illuminate/session": "Required to use the session based guard (5.6.*)." }, "config": { "sort-packages": true diff --git a/src/Illuminate/Broadcasting/composer.json b/src/Illuminate/Broadcasting/composer.json index d8bbb74acf6f..bd34d160ead4 100644 --- a/src/Illuminate/Broadcasting/composer.json +++ b/src/Illuminate/Broadcasting/composer.json @@ -15,10 +15,10 @@ ], "require": { "php": ">=7.0", - "illuminate/bus": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/queue": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/bus": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/queue": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { diff --git a/src/Illuminate/Bus/composer.json b/src/Illuminate/Bus/composer.json index 3836cee9b7e7..a95e4815265e 100644 --- a/src/Illuminate/Bus/composer.json +++ b/src/Illuminate/Bus/composer.json @@ -15,9 +15,9 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/pipeline": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/pipeline": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Cache/composer.json b/src/Illuminate/Cache/composer.json index f81a218c707e..69ff3d20b962 100755 --- a/src/Illuminate/Cache/composer.json +++ b/src/Illuminate/Cache/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -25,13 +25,13 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { - "illuminate/database": "Required to use the database cache driver (5.5.*).", - "illuminate/filesystem": "Required to use the file cache driver (5.5.*).", - "illuminate/redis": "Required to use the redis cache driver (5.5.*)." + "illuminate/database": "Required to use the database cache driver (5.6.*).", + "illuminate/filesystem": "Required to use the file cache driver (5.6.*).", + "illuminate/redis": "Required to use the redis cache driver (5.6.*)." }, "config": { "sort-packages": true diff --git a/src/Illuminate/Config/composer.json b/src/Illuminate/Config/composer.json index 55d6f0a0e0f0..3cd7bb53a9f9 100755 --- a/src/Illuminate/Config/composer.json +++ b/src/Illuminate/Config/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Console/composer.json b/src/Illuminate/Console/composer.json index 6e432e03e59f..87158ef7b3b3 100755 --- a/src/Illuminate/Console/composer.json +++ b/src/Illuminate/Console/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", "symfony/console": "~3.3" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { diff --git a/src/Illuminate/Container/composer.json b/src/Illuminate/Container/composer.json index 7347da14a73f..46f3d1e82641 100755 --- a/src/Illuminate/Container/composer.json +++ b/src/Illuminate/Container/composer.json @@ -15,7 +15,7 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", + "illuminate/contracts": "5.6.*", "psr/container": "~1.0" }, "autoload": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Contracts/composer.json b/src/Illuminate/Contracts/composer.json index c97fc256a5ca..9d7ff975b2bd 100644 --- a/src/Illuminate/Contracts/composer.json +++ b/src/Illuminate/Contracts/composer.json @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Cookie/composer.json b/src/Illuminate/Cookie/composer.json index e9a85cd64a34..774a4c7abfd9 100755 --- a/src/Illuminate/Cookie/composer.json +++ b/src/Illuminate/Cookie/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", "symfony/http-foundation": "~3.3", "symfony/http-kernel": "~3.3" }, @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Database/composer.json b/src/Illuminate/Database/composer.json index 153abad646f2..5e69ea7f56ff 100644 --- a/src/Illuminate/Database/composer.json +++ b/src/Illuminate/Database/composer.json @@ -16,9 +16,9 @@ ], "require": { "php": ">=7.0", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -27,16 +27,16 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "illuminate/console": "Required to use the database commands (5.5.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.5.*).", - "illuminate/filesystem": "Required to use the migrations (5.5.*).", - "illuminate/pagination": "Required to paginate the result set (5.5.*)." + "illuminate/console": "Required to use the database commands (5.6.*).", + "illuminate/events": "Required to use the observers with Eloquent (5.6.*).", + "illuminate/filesystem": "Required to use the migrations (5.6.*).", + "illuminate/pagination": "Required to paginate the result set (5.6.*)." }, "config": { "sort-packages": true diff --git a/src/Illuminate/Encryption/composer.json b/src/Illuminate/Encryption/composer.json index 0887e6fa152d..40eb5945040c 100644 --- a/src/Illuminate/Encryption/composer.json +++ b/src/Illuminate/Encryption/composer.json @@ -17,8 +17,8 @@ "php": ">=7.0", "ext-mbstring": "*", "ext-openssl": "*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Events/composer.json b/src/Illuminate/Events/composer.json index 772cab000010..87fa92658589 100755 --- a/src/Illuminate/Events/composer.json +++ b/src/Illuminate/Events/composer.json @@ -15,9 +15,9 @@ ], "require": { "php": ">=7.0", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Filesystem/composer.json b/src/Illuminate/Filesystem/composer.json index 3f09194272eb..26184bc6304f 100644 --- a/src/Illuminate/Filesystem/composer.json +++ b/src/Illuminate/Filesystem/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", "symfony/finder": "~3.3" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index f47c5b62b7d9..e1301b1ff3a8 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -29,7 +29,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '5.5.0'; + const VERSION = '5.6-dev'; /** * The base path for the Laravel installation. diff --git a/src/Illuminate/Hashing/composer.json b/src/Illuminate/Hashing/composer.json index d727f86c9592..369fe66b8979 100755 --- a/src/Illuminate/Hashing/composer.json +++ b/src/Illuminate/Hashing/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Http/composer.json b/src/Illuminate/Http/composer.json index a634cd284c6d..41666813520e 100755 --- a/src/Illuminate/Http/composer.json +++ b/src/Illuminate/Http/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/session": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/session": "5.6.*", + "illuminate/support": "5.6.*", "symfony/http-foundation": "~3.3", "symfony/http-kernel": "~3.3" }, @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Log/composer.json b/src/Illuminate/Log/composer.json index 5fe136438433..192b40e88641 100755 --- a/src/Illuminate/Log/composer.json +++ b/src/Illuminate/Log/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", "monolog/monolog": "~1.11" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Mail/composer.json b/src/Illuminate/Mail/composer.json index 6343a9234c73..fe06844e7fa2 100755 --- a/src/Illuminate/Mail/composer.json +++ b/src/Illuminate/Mail/composer.json @@ -16,9 +16,9 @@ "require": { "php": ">=7.0", "erusev/parsedown": "~1.6", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", "psr/log": "~1.0", "swiftmailer/swiftmailer": "~6.0", "tijsverkoyen/css-to-inline-styles": "~2.2" @@ -30,7 +30,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { diff --git a/src/Illuminate/Notifications/composer.json b/src/Illuminate/Notifications/composer.json index 3e7264f9aa09..09eb1fb7e55c 100644 --- a/src/Illuminate/Notifications/composer.json +++ b/src/Illuminate/Notifications/composer.json @@ -15,14 +15,14 @@ ], "require": { "php": ">=7.0", - "illuminate/broadcasting": "5.5.*", - "illuminate/bus": "5.5.*", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/filesystem": "5.5.*", - "illuminate/mail": "5.5.*", - "illuminate/queue": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/broadcasting": "5.6.*", + "illuminate/bus": "5.6.*", + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/filesystem": "5.6.*", + "illuminate/mail": "5.6.*", + "illuminate/queue": "5.6.*", + "illuminate/support": "5.6.*", "ramsey/uuid": "~3.0" }, "autoload": { @@ -32,12 +32,12 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { "guzzlehttp/guzzle": "Required to use the Slack transport (~6.0)", - "illuminate/database": "Required to use the database transport (5.5.*).", + "illuminate/database": "Required to use the database transport (5.6.*).", "nexmo/client": "Required to use the Nexmo transport (~1.0)." }, "config": { diff --git a/src/Illuminate/Pagination/composer.json b/src/Illuminate/Pagination/composer.json index 48bcc06214af..3125ddc459db 100755 --- a/src/Illuminate/Pagination/composer.json +++ b/src/Illuminate/Pagination/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Pipeline/composer.json b/src/Illuminate/Pipeline/composer.json index 3b85f815cb06..b9bc9df56909 100644 --- a/src/Illuminate/Pipeline/composer.json +++ b/src/Illuminate/Pipeline/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Queue/composer.json b/src/Illuminate/Queue/composer.json index c8d582ac8799..5264307c6697 100644 --- a/src/Illuminate/Queue/composer.json +++ b/src/Illuminate/Queue/composer.json @@ -15,12 +15,12 @@ ], "require": { "php": ">=7.0", - "illuminate/console": "5.5.*", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/database": "5.5.*", - "illuminate/filesystem": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/console": "5.6.*", + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/database": "5.6.*", + "illuminate/filesystem": "5.6.*", + "illuminate/support": "5.6.*", "symfony/debug": "~3.3", "symfony/process": "~3.3" }, @@ -31,12 +31,12 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver (~3.0).", - "illuminate/redis": "Required to use the Redis queue driver (5.5.*).", + "illuminate/redis": "Required to use the Redis queue driver (5.6.*).", "pda/pheanstalk": "Required to use the Beanstalk queue driver (~3.0)." }, "config": { diff --git a/src/Illuminate/Redis/composer.json b/src/Illuminate/Redis/composer.json index 741a13ed4fd1..b3cc598d9f77 100755 --- a/src/Illuminate/Redis/composer.json +++ b/src/Illuminate/Redis/composer.json @@ -15,8 +15,8 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", "predis/predis": "~1.0" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Routing/composer.json b/src/Illuminate/Routing/composer.json index 810c9d763098..8ec693e92287 100644 --- a/src/Illuminate/Routing/composer.json +++ b/src/Illuminate/Routing/composer.json @@ -15,12 +15,12 @@ ], "require": { "php": ">=7.0", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/http": "5.5.*", - "illuminate/pipeline": "5.5.*", - "illuminate/session": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/http": "5.6.*", + "illuminate/pipeline": "5.6.*", + "illuminate/session": "5.6.*", + "illuminate/support": "5.6.*", "symfony/debug": "~3.3", "symfony/http-foundation": "~3.3", "symfony/http-kernel": "~3.3", @@ -33,11 +33,11 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { - "illuminate/console": "Required to use the make commands (5.5.*).", + "illuminate/console": "Required to use the make commands (5.6.*).", "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." }, "config": { diff --git a/src/Illuminate/Session/composer.json b/src/Illuminate/Session/composer.json index a854c506b2b4..e29fe0c1b24a 100755 --- a/src/Illuminate/Session/composer.json +++ b/src/Illuminate/Session/composer.json @@ -15,9 +15,9 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/filesystem": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/contracts": "5.6.*", + "illuminate/filesystem": "5.6.*", + "illuminate/support": "5.6.*", "symfony/finder": "~3.3", "symfony/http-foundation": "~3.3" }, @@ -28,11 +28,11 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { - "illuminate/console": "Required to use the session:table command (5.5.*)." + "illuminate/console": "Required to use the session:table command (5.6.*)." }, "config": { "sort-packages": true diff --git a/src/Illuminate/Support/composer.json b/src/Illuminate/Support/composer.json index 172303dc4c19..f735b17ed825 100644 --- a/src/Illuminate/Support/composer.json +++ b/src/Illuminate/Support/composer.json @@ -17,7 +17,7 @@ "php": ">=7.0", "ext-mbstring": "*", "doctrine/inflector": "~1.1", - "illuminate/contracts": "5.5.*", + "illuminate/contracts": "5.6.*", "nesbot/carbon": "^1.20" }, "replace": { @@ -33,7 +33,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { diff --git a/src/Illuminate/Translation/composer.json b/src/Illuminate/Translation/composer.json index b84b17fde1d1..22ec882f3542 100755 --- a/src/Illuminate/Translation/composer.json +++ b/src/Illuminate/Translation/composer.json @@ -15,9 +15,9 @@ ], "require": { "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "illuminate/filesystem": "5.5.*", - "illuminate/support": "5.5.*" + "illuminate/contracts": "5.6.*", + "illuminate/filesystem": "5.6.*", + "illuminate/support": "5.6.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/src/Illuminate/Validation/composer.json b/src/Illuminate/Validation/composer.json index a026981bb818..c5deb35f4137 100755 --- a/src/Illuminate/Validation/composer.json +++ b/src/Illuminate/Validation/composer.json @@ -15,10 +15,10 @@ ], "require": { "php": ">=7.0", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", - "illuminate/translation": "5.5.*", + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/support": "5.6.*", + "illuminate/translation": "5.6.*", "symfony/http-foundation": "~3.3" }, "autoload": { @@ -28,11 +28,11 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { - "illuminate/database": "Required to use the database presence verifier (5.5.*)." + "illuminate/database": "Required to use the database presence verifier (5.6.*)." }, "config": { "sort-packages": true diff --git a/src/Illuminate/View/composer.json b/src/Illuminate/View/composer.json index 142c75593ae0..8ffa7b8506bb 100644 --- a/src/Illuminate/View/composer.json +++ b/src/Illuminate/View/composer.json @@ -15,11 +15,11 @@ ], "require": { "php": ">=7.0", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/events": "5.5.*", - "illuminate/filesystem": "5.5.*", - "illuminate/support": "5.5.*", + "illuminate/container": "5.6.*", + "illuminate/contracts": "5.6.*", + "illuminate/events": "5.6.*", + "illuminate/filesystem": "5.6.*", + "illuminate/support": "5.6.*", "symfony/debug": "~3.3" }, "autoload": { @@ -29,7 +29,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "config": { diff --git a/tests/Console/ConsoleApplicationTest.php b/tests/Console/ConsoleApplicationTest.php index a5924311c642..76b658339267 100755 --- a/tests/Console/ConsoleApplicationTest.php +++ b/tests/Console/ConsoleApplicationTest.php @@ -47,7 +47,7 @@ public function testResolveAddsCommandViaApplicationResolution() protected function getMockConsole(array $methods) { - $app = m::mock('Illuminate\Contracts\Foundation\Application', ['version' => '5.5']); + $app = m::mock('Illuminate\Contracts\Foundation\Application', ['version' => '5.6']); $events = m::mock('Illuminate\Contracts\Events\Dispatcher', ['dispatch' => null]); $console = $this->getMockBuilder('Illuminate\Console\Application')->setMethods($methods)->setConstructorArgs([ diff --git a/tests/Support/SupportTestingMailFakeTest.php b/tests/Support/SupportTestingMailFakeTest.php index 1bb4a39cb3e6..8a2a7ead675c 100644 --- a/tests/Support/SupportTestingMailFakeTest.php +++ b/tests/Support/SupportTestingMailFakeTest.php @@ -111,7 +111,7 @@ class MailableStub extends Mailable { public $framework = 'Laravel'; - protected $version = '5.5'; + protected $version = '5.6'; /** * Build the message. @@ -129,7 +129,7 @@ class QueueableMailableStub extends Mailable implements ShouldQueue { public $framework = 'Laravel'; - protected $version = '5.5'; + protected $version = '5.6'; /** * Build the message. From 492030019b521540aadc46fa919a8c53f72df57b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 1 Sep 2017 08:34:31 +0200 Subject: [PATCH 04/66] 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 f9f24bd32303..e1301b1ff3a8 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -29,7 +29,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '5.5.1'; + const VERSION = '5.6-dev'; /** * The base path for the Laravel installation. From 72f14ecab64828e5334f8b5278da4848c933c15d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 1 Sep 2017 08:34:48 +0200 Subject: [PATCH 05/66] branch alias --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dff45ac60a52..08513c601287 100644 --- a/composer.json +++ b/composer.json @@ -102,7 +102,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "suggest": { From 747771405090139378b648742ccc73649c100099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Sun, 3 Sep 2017 09:13:44 -0700 Subject: [PATCH 06/66] add 5.6 changelog --- CHANGELOG-5.6.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 CHANGELOG-5.6.md diff --git a/CHANGELOG-5.6.md b/CHANGELOG-5.6.md new file mode 100644 index 000000000000..83f726f65f02 --- /dev/null +++ b/CHANGELOG-5.6.md @@ -0,0 +1,6 @@ +# Release Notes for 5.6.x + +## [Unreleased] + +### Artisan Console +- Removed deprecated `optimize` command ([#20851](https://github.com/laravel/framework/pull/20851)) From 1cb751263ed4cc26d632047c670ed82572a6b06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Guimar=C3=A3es?= Date: Mon, 4 Sep 2017 11:02:58 -0300 Subject: [PATCH 07/66] [5.6] Allow methods to be bound using ::class notation (#20957) * allows methods to be bound using ::class notation * styleci * Update Container.php --- src/Illuminate/Container/Container.php | 19 +++++++++++++++++-- tests/Container/ContainerTest.php | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index 54d10354876a..a4b479aea1d7 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -271,13 +271,28 @@ public function hasMethodBinding($method) /** * Bind a callback to resolve with Container::call. * - * @param string $method + * @param array|string $method * @param \Closure $callback * @return void */ public function bindMethod($method, $callback) { - $this->methodBindings[$method] = $callback; + $this->methodBindings[$this->parseBindMethod($method)] = $callback; + } + + /** + * Get the method to be bound in class@method format. + * + * @param array|string $method + * @return string + */ + protected function parseBindMethod($method) + { + if (is_array($method)) { + return $method[0].'@'.$method[1]; + } + + return $method; } /** diff --git a/tests/Container/ContainerTest.php b/tests/Container/ContainerTest.php index 23159e32a7a6..c8bb3896d7fd 100755 --- a/tests/Container/ContainerTest.php +++ b/tests/Container/ContainerTest.php @@ -563,6 +563,23 @@ public function testCallWithBoundMethod() $this->assertEquals(['foo', 'bar'], $result); } + public function testBindMethodAcceptsAnArray() + { + $container = new Container; + $container->bindMethod([\Illuminate\Tests\Container\ContainerTestCallStub::class, 'unresolvable'], function ($stub) { + return $stub->unresolvable('foo', 'bar'); + }); + $result = $container->call('Illuminate\Tests\Container\ContainerTestCallStub@unresolvable'); + $this->assertEquals(['foo', 'bar'], $result); + + $container = new Container; + $container->bindMethod([\Illuminate\Tests\Container\ContainerTestCallStub::class, 'unresolvable'], function ($stub) { + return $stub->unresolvable('foo', 'bar'); + }); + $result = $container->call([new ContainerTestCallStub, 'unresolvable']); + $this->assertEquals(['foo', 'bar'], $result); + } + public function testContainerCanInjectDifferentImplementationsDependingOnContext() { $container = new Container; From 38a6878e210765cb986c9bf32f831684e095e426 Mon Sep 17 00:00:00 2001 From: Sije Harkema Date: Wed, 6 Sep 2017 15:29:18 +0200 Subject: [PATCH 08/66] Include runningUnitTests in Application Contract (#21034) resubmit of https://github.com/laravel/framework/pull/21033 , now on master --- src/Illuminate/Contracts/Foundation/Application.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Illuminate/Contracts/Foundation/Application.php b/src/Illuminate/Contracts/Foundation/Application.php index a7d643b15ace..6824f4b84498 100644 --- a/src/Illuminate/Contracts/Foundation/Application.php +++ b/src/Illuminate/Contracts/Foundation/Application.php @@ -33,6 +33,13 @@ public function environment(); * @return bool */ public function runningInConsole(); + + /** + * Determine if we are running unit tests. + * + * @return bool + */ + public function runningUnitTests(); /** * Determine if the application is currently down for maintenance. From 8eb3de12720c7bd53a411748ad282bfbda57a948 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 6 Sep 2017 15:29:31 +0200 Subject: [PATCH 09/66] Apply fixes from StyleCI (#21035) --- src/Illuminate/Contracts/Foundation/Application.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Contracts/Foundation/Application.php b/src/Illuminate/Contracts/Foundation/Application.php index 6824f4b84498..6fc804784cd9 100644 --- a/src/Illuminate/Contracts/Foundation/Application.php +++ b/src/Illuminate/Contracts/Foundation/Application.php @@ -33,8 +33,8 @@ public function environment(); * @return bool */ public function runningInConsole(); - - /** + + /** * Determine if we are running unit tests. * * @return bool From 9f4ac846612b3e5f8acc6f15d63a70457890fb9f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 6 Sep 2017 08:30:25 -0500 Subject: [PATCH 10/66] comments --- src/Illuminate/Contracts/Foundation/Application.php | 4 ++-- src/Illuminate/Foundation/Application.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Contracts/Foundation/Application.php b/src/Illuminate/Contracts/Foundation/Application.php index 6fc804784cd9..810f929b4e64 100644 --- a/src/Illuminate/Contracts/Foundation/Application.php +++ b/src/Illuminate/Contracts/Foundation/Application.php @@ -28,14 +28,14 @@ public function basePath(); public function environment(); /** - * Determine if we are running in the console. + * Determine if the application is running in the console. * * @return bool */ public function runningInConsole(); /** - * Determine if we are running unit tests. + * Determine if the application is running unit tests. * * @return bool */ diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 2091e25bc1d2..d67d8daa98f1 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -524,7 +524,7 @@ public function detectEnvironment(Closure $callback) } /** - * Determine if we are running in the console. + * Determine if the application is running in the console. * * @return bool */ @@ -534,7 +534,7 @@ public function runningInConsole() } /** - * Determine if we are running unit tests. + * Determine if the application is running unit tests. * * @return bool */ From 230eeef6113bf7a5632578508c3316583ac22534 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 13 Sep 2017 15:20:02 -0500 Subject: [PATCH 11/66] make unserialized models reload relationships - add new `getQueueableRelations` method to queuable interfaces - accept the 'relations' into the `ModelIdentifier` - implement `getQueueableRelations` method on Eloquent Collection and Model. - extract a method on `SerializesAndRestoresModelIdentifiers` for `restoreModel`. Load the relationships in this method. - add test --- .../Contracts/Database/ModelIdentifier.php | 11 ++- .../Contracts/Queue/QueueableCollection.php | 7 ++ .../Contracts/Queue/QueueableEntity.php | 7 ++ .../Database/Eloquent/Collection.php | 10 ++ src/Illuminate/Database/Eloquent/Model.php | 32 ++++++ .../SerializesAndRestoresModelIdentifiers.php | 21 +++- .../Queue/ModelSerializationTest.php | 99 +++++++++++++++++++ tests/Queue/QueueSyncQueueTest.php | 5 + 8 files changed, 187 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Contracts/Database/ModelIdentifier.php b/src/Illuminate/Contracts/Database/ModelIdentifier.php index 587044a8dab3..cdd4b9cc91a2 100644 --- a/src/Illuminate/Contracts/Database/ModelIdentifier.php +++ b/src/Illuminate/Contracts/Database/ModelIdentifier.php @@ -27,18 +27,27 @@ class ModelIdentifier */ public $connection; + /** + * The relationships loaded on the model. + * + * @var array + */ + public $relations; + /** * Create a new model identifier. * * @param string $class * @param mixed $id * @param mixed $connection + * @param array $relations * @return void */ - public function __construct($class, $id, $connection) + public function __construct($class, $id, $connection, $relations) { $this->id = $id; $this->class = $class; $this->connection = $connection; + $this->relations = $relations; } } diff --git a/src/Illuminate/Contracts/Queue/QueueableCollection.php b/src/Illuminate/Contracts/Queue/QueueableCollection.php index 0331b814f04b..a26fa57ab4d3 100644 --- a/src/Illuminate/Contracts/Queue/QueueableCollection.php +++ b/src/Illuminate/Contracts/Queue/QueueableCollection.php @@ -24,4 +24,11 @@ public function getQueueableIds(); * @return string|null */ public function getQueueableConnection(); + + /** + * Get the relationships of the entities being queued. + * + * @return array + */ + public function getQueueableRelations(); } diff --git a/src/Illuminate/Contracts/Queue/QueueableEntity.php b/src/Illuminate/Contracts/Queue/QueueableEntity.php index 00e28f8a070f..2388e1e2183c 100644 --- a/src/Illuminate/Contracts/Queue/QueueableEntity.php +++ b/src/Illuminate/Contracts/Queue/QueueableEntity.php @@ -17,4 +17,11 @@ public function getQueueableId(); * @return string|null */ public function getQueueableConnection(); + + /** + * Get the relationships for the entity. + * + * @return array + */ + public function getQueueableRelations(); } diff --git a/src/Illuminate/Database/Eloquent/Collection.php b/src/Illuminate/Database/Eloquent/Collection.php index 62e25c6dabd9..914e480f49ae 100755 --- a/src/Illuminate/Database/Eloquent/Collection.php +++ b/src/Illuminate/Database/Eloquent/Collection.php @@ -419,4 +419,14 @@ public function getQueueableConnection() return $connection; } + + /** + * Get the relationships of the entities being queued. + * + * @return array + */ + public function getQueueableRelations() + { + return $this->isNotEmpty() ? $this->first()->getRelations() : []; + } } diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index bee9bf0e47fb..43a5b93c0b13 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -13,6 +13,7 @@ use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Database\Eloquent\Relations\Pivot; +use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\ConnectionResolverInterface as Resolver; @@ -1250,6 +1251,37 @@ public function getQueueableConnection() return $this->getConnectionName(); } + /** + * Get the queueable relationships for the entity. + * + * @return array + */ + public function getQueueableRelations() + { + $relations = []; + + foreach ($this->getRelations() as $key => $relation){ + + $relations[] = $key; + + if ($relation instanceof QueueableCollection) + { + foreach($relation->getQueueableRelations() as $collectionKey => $collectionValue){ + $relations[] = $key . '.' . $collectionKey; + } + } + + if ($relation instanceof QueueableEntity) + { + foreach($relation->getQueueableRelations() as $entityKey => $entityValue){ + $relations[] = $key . '.' . $entityValue; + } + } + } + + return $relations; + } + /** * Get the value of the model's route key. * diff --git a/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php b/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php index 6bb677aee8ac..e90a0b8ea3b3 100644 --- a/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php +++ b/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php @@ -21,7 +21,8 @@ protected function getSerializedPropertyValue($value) return new ModelIdentifier( $value->getQueueableClass(), $value->getQueueableIds(), - $value->getQueueableConnection() + $value->getQueueableConnection(), + $value->getQueueableRelations() ); } @@ -29,7 +30,8 @@ protected function getSerializedPropertyValue($value) return new ModelIdentifier( get_class($value), $value->getQueueableId(), - $value->getQueueableConnection() + $value->getQueueableConnection(), + $value->getQueueableRelations() ); } @@ -50,8 +52,7 @@ protected function getRestoredPropertyValue($value) return is_array($value->id) ? $this->restoreCollection($value) - : $this->getQueryForModelRestoration((new $value->class)->setConnection($value->connection)) - ->useWritePdo()->findOrFail($value->id); + : $this->restoreModel($value); } /** @@ -72,6 +73,18 @@ protected function restoreCollection($value) ->whereIn($model->getQualifiedKeyName(), $value->id)->get(); } + /** + * @param \Illuminate\Contracts\Database\ModelIdentifier $value + * @return \Illuminate\Database\Eloquent\Model + */ + public function restoreModel($value) + { + $model = $this->getQueryForModelRestoration((new $value->class)->setConnection($value->connection)) + ->useWritePdo()->findOrFail($value->id); + + return $model->load($value->relations); + } + /** * Get the query for restoration. * diff --git a/tests/Integration/Queue/ModelSerializationTest.php b/tests/Integration/Queue/ModelSerializationTest.php index 0949b683f78c..1cfe302bd7c3 100644 --- a/tests/Integration/Queue/ModelSerializationTest.php +++ b/tests/Integration/Queue/ModelSerializationTest.php @@ -43,6 +43,21 @@ public function setUp() $table->increments('id'); $table->string('email'); }); + + Schema::create('orders', function ($table) { + $table->increments('id'); + }); + + Schema::create('lines', function ($table) { + $table->increments('id'); + $table->unsignedInteger('order_id'); + $table->unsignedInteger('product_id'); + }); + + Schema::create('products', function ($table) { + $table->increments('id'); + + }); } /** @@ -126,6 +141,50 @@ public function it_fails_if_models_on_multi_connections() unserialize($serialized); } + + /** + * @test + */ + public function it_reloads_relationships() + { + $order = Order::create(); + + $product1 = Product::create(); + $product2 = Product::create(); + + Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); + Line::create(['order_id' => $order->id, 'product_id' => $product2->id]); + Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); + + $order->load('lines'); + + $serialized = serialize(new ModelRelationSerializationTestClass($order)); + $unSerialized = unserialize($serialized); + + $this->assertEquals($unSerialized->order->getRelations(), $order->getRelations()); + } + + /** + * @test + */ + public function it_reloads_nested_relationships() + { + $order = Order::create(); + + $product1 = Product::create(); + $product2 = Product::create(); + + Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); + Line::create(['order_id' => $order->id, 'product_id' => $product2->id]); + Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); + + $order->load('lines', 'lines.product'); + + $nestedSerialized = serialize(new ModelRelationSerializationTestClass($order)); + $nestedUnSerialized = unserialize($nestedSerialized); + + $this->assertEquals($nestedUnSerialized->order->getRelations(), $order->getRelations()); + } } class ModelSerializationTestUser extends Model @@ -135,6 +194,34 @@ class ModelSerializationTestUser extends Model public $timestamps = false; } +class Order extends Model +{ + public $guarded = ['id']; + public $timestamps = false; + + public function lines() + { + return $this->hasMany(Line::class); + } +} + +class Line extends Model +{ + public $guarded = ['id']; + public $timestamps = false; + + public function product() + { + return $this->belongsTo(Product::class); + } +} + +class Product extends Model +{ + public $guarded = ['id']; + public $timestamps = false; +} + class ModelSerializationTestClass { use \Illuminate\Queue\SerializesModels; @@ -146,3 +233,15 @@ public function __construct($user) $this->user = $user; } } + +class ModelRelationSerializationTestClass +{ + use \Illuminate\Queue\SerializesModels; + + public $order; + + public function __construct($order) + { + $this->order = $order; + } +} diff --git a/tests/Queue/QueueSyncQueueTest.php b/tests/Queue/QueueSyncQueueTest.php index 8d533c8b197f..cbbac59c9c4a 100755 --- a/tests/Queue/QueueSyncQueueTest.php +++ b/tests/Queue/QueueSyncQueueTest.php @@ -61,6 +61,11 @@ public function getQueueableConnection() { // } + + public function getQueueableRelations() + { + // + } } class SyncQueueTestHandler From 85c1081b26b7cd2411f5ab9b2b5c734e22931933 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 14 Sep 2017 08:06:52 -0500 Subject: [PATCH 12/66] remove unneeded order lines --- tests/Integration/Queue/ModelSerializationTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Integration/Queue/ModelSerializationTest.php b/tests/Integration/Queue/ModelSerializationTest.php index 1cfe302bd7c3..829f6cd1eb30 100644 --- a/tests/Integration/Queue/ModelSerializationTest.php +++ b/tests/Integration/Queue/ModelSerializationTest.php @@ -154,7 +154,6 @@ public function it_reloads_relationships() Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); Line::create(['order_id' => $order->id, 'product_id' => $product2->id]); - Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); $order->load('lines'); @@ -176,7 +175,6 @@ public function it_reloads_nested_relationships() Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); Line::create(['order_id' => $order->id, 'product_id' => $product2->id]); - Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); $order->load('lines', 'lines.product'); From 3c3c877d0626dd5258cf64fd1967f08dcb722481 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 14 Sep 2017 08:47:45 -0500 Subject: [PATCH 13/66] styleCI fixes --- src/Illuminate/Database/Eloquent/Model.php | 31 +++++++++---------- .../Queue/ModelSerializationTest.php | 1 - 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 43a5b93c0b13..11739533f9bf 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -2,20 +2,20 @@ namespace Illuminate\Database\Eloquent; -use Exception; use ArrayAccess; -use JsonSerializable; use BadMethodCallException; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Contracts\Routing\UrlRoutable; +use Exception; +use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Contracts\Queue\QueueableEntity; +use Illuminate\Contracts\Routing\UrlRoutable; +use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Contracts\Support\Jsonable; +use Illuminate\Database\ConnectionResolverInterface as Resolver; use Illuminate\Database\Eloquent\Relations\Pivot; -use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Database\Query\Builder as QueryBuilder; -use Illuminate\Database\ConnectionResolverInterface as Resolver; +use Illuminate\Support\Arr; +use Illuminate\Support\Str; +use JsonSerializable; /** * @mixin \Illuminate\Database\Eloquent\Builder @@ -1260,20 +1260,17 @@ public function getQueueableRelations() { $relations = []; - foreach ($this->getRelations() as $key => $relation){ - + foreach ($this->getRelations() as $key => $relation) { $relations[] = $key; - if ($relation instanceof QueueableCollection) - { - foreach($relation->getQueueableRelations() as $collectionKey => $collectionValue){ + if ($relation instanceof QueueableCollection) { + foreach ($relation->getQueueableRelations() as $collectionKey => $collectionValue) { $relations[] = $key . '.' . $collectionKey; } } - if ($relation instanceof QueueableEntity) - { - foreach($relation->getQueueableRelations() as $entityKey => $entityValue){ + if ($relation instanceof QueueableEntity) { + foreach ($relation->getQueueableRelations() as $entityKey => $entityValue) { $relations[] = $key . '.' . $entityValue; } } diff --git a/tests/Integration/Queue/ModelSerializationTest.php b/tests/Integration/Queue/ModelSerializationTest.php index 829f6cd1eb30..89b3b89ffbc9 100644 --- a/tests/Integration/Queue/ModelSerializationTest.php +++ b/tests/Integration/Queue/ModelSerializationTest.php @@ -56,7 +56,6 @@ public function setUp() Schema::create('products', function ($table) { $table->increments('id'); - }); } From 98ee9bac3bb89b7afc897f16fd9abc2676337490 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 14 Sep 2017 08:53:31 -0500 Subject: [PATCH 14/66] one more try at styleci --- src/Illuminate/Database/Eloquent/Model.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 11739533f9bf..8aa938b5f77b 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -2,20 +2,20 @@ namespace Illuminate\Database\Eloquent; +use Exception; use ArrayAccess; +use JsonSerializable; use BadMethodCallException; -use Exception; -use Illuminate\Contracts\Queue\QueueableCollection; -use Illuminate\Contracts\Queue\QueueableEntity; -use Illuminate\Contracts\Routing\UrlRoutable; -use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Support\Arr; +use Illuminate\Support\Str; use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Database\ConnectionResolverInterface as Resolver; +use Illuminate\Contracts\Support\Arrayable; +use Illuminate\Contracts\Routing\UrlRoutable; +use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Database\Eloquent\Relations\Pivot; +use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Database\Query\Builder as QueryBuilder; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use JsonSerializable; +use Illuminate\Database\ConnectionResolverInterface as Resolver; /** * @mixin \Illuminate\Database\Eloquent\Builder @@ -1265,13 +1265,13 @@ public function getQueueableRelations() if ($relation instanceof QueueableCollection) { foreach ($relation->getQueueableRelations() as $collectionKey => $collectionValue) { - $relations[] = $key . '.' . $collectionKey; + $relations[] = $key.'.'.$collectionKey; } } if ($relation instanceof QueueableEntity) { foreach ($relation->getQueueableRelations() as $entityKey => $entityValue) { - $relations[] = $key . '.' . $entityValue; + $relations[] = $key.'.'.$entityValue; } } } From 2ec2e300ecaa032f7e098bf6ea69d9945f88f4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Fri, 15 Sep 2017 16:30:07 -0700 Subject: [PATCH 15/66] update v5.6 changelog --- CHANGELOG-5.6.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG-5.6.md b/CHANGELOG-5.6.md index 83f726f65f02..2b8a76a67d47 100644 --- a/CHANGELOG-5.6.md +++ b/CHANGELOG-5.6.md @@ -2,5 +2,8 @@ ## [Unreleased] +### General +- Added `runningUnitTests()` to `Application` contract ([#21034](https://github.com/laravel/framework/pull/21034)) + ### Artisan Console - Removed deprecated `optimize` command ([#20851](https://github.com/laravel/framework/pull/20851)) From 5bfedaae3e62bb23c43908542195cb88107a0196 Mon Sep 17 00:00:00 2001 From: Christopher Thomas Date: Mon, 18 Sep 2017 05:35:17 -0700 Subject: [PATCH 16/66] Include job ID in the output of the queue:work Artisan command (#21204) --- src/Illuminate/Queue/Console/WorkCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Queue/Console/WorkCommand.php b/src/Illuminate/Queue/Console/WorkCommand.php index 750d13398be1..8d759c7d0983 100644 --- a/src/Illuminate/Queue/Console/WorkCommand.php +++ b/src/Illuminate/Queue/Console/WorkCommand.php @@ -168,8 +168,9 @@ protected function writeOutput(Job $job, $status) protected function writeStatus(Job $job, $status, $type) { $this->output->writeln(sprintf( - "<{$type}>[%s] %s %s", + "<{$type}>[%s][%s] %s %s", Carbon::now()->format('Y-m-d H:i:s'), + $job->getJobId(), str_pad("{$status}:", 11), $job->resolveName() )); } From f56fa30853c77b8d2496a94c29b8bf2917edef22 Mon Sep 17 00:00:00 2001 From: Charles Peterson Date: Wed, 20 Sep 2017 14:17:06 -0500 Subject: [PATCH 17/66] Job contract interface updated to include common methods in the abstract Job class --- src/Illuminate/Contracts/Queue/Job.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Illuminate/Contracts/Queue/Job.php b/src/Illuminate/Contracts/Queue/Job.php index 8a907987a35c..22396fc0044c 100644 --- a/src/Illuminate/Contracts/Queue/Job.php +++ b/src/Illuminate/Contracts/Queue/Job.php @@ -112,4 +112,18 @@ public function getQueue(); * @return string */ public function getRawBody(); + + /** + * Get the decoded body of the job. + * + * @return array + */ + public function payload(); + + /** + * Get the job identifier. + * + * @return string + */ + public function getJobId(); } From 88cbfa4e68db2479de766b11f3d3eb3e525deb80 Mon Sep 17 00:00:00 2001 From: Charles Peterson Date: Wed, 20 Sep 2017 14:19:02 -0500 Subject: [PATCH 18/66] Job class added the required getJobId to the abstract class this method is used in all existing Illuminate/Queue/Jobs/* classes also allows better code completion via the addition in the Contract. --- src/Illuminate/Queue/Jobs/Job.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Illuminate/Queue/Jobs/Job.php b/src/Illuminate/Queue/Jobs/Job.php index 20b48222a485..9139332628a7 100755 --- a/src/Illuminate/Queue/Jobs/Job.php +++ b/src/Illuminate/Queue/Jobs/Job.php @@ -62,6 +62,13 @@ abstract class Job */ abstract public function getRawBody(); + /** + * Get the job identifier. + * + * @return string + */ + abstract public function getJobId(); + /** * Fire the job. * From c04958bc17bd98605df959e8ea98ad2db09a0c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20D=C3=ADaz?= Date: Thu, 21 Sep 2017 15:43:29 +0200 Subject: [PATCH 19/66] Allow setting custom morphTo ownerKey. (#21310) --- .../Eloquent/Concerns/HasRelationships.php | 17 ++++++++++------- .../Database/Eloquent/Relations/MorphTo.php | 10 +++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php b/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php index d5599da4378c..a6d6f7ede8db 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php @@ -128,9 +128,10 @@ public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relat * @param string $name * @param string $type * @param string $id + * @param string $ownerKey * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ - public function morphTo($name = null, $type = null, $id = null) + public function morphTo($name = null, $type = null, $id = null, $ownerKey = null) { // If no name is provided, we will use the backtrace to get the function name // since that is most likely the name of the polymorphic interface. We can @@ -145,8 +146,8 @@ public function morphTo($name = null, $type = null, $id = null) // the relationship. In this case we'll just pass in a dummy query where we // need to remove any eager loads that may already be defined on a model. return empty($class = $this->{$type}) - ? $this->morphEagerTo($name, $type, $id) - : $this->morphInstanceTo($class, $name, $type, $id); + ? $this->morphEagerTo($name, $type, $id, $ownerKey) + : $this->morphInstanceTo($class, $name, $type, $id, $ownerKey); } /** @@ -155,12 +156,13 @@ public function morphTo($name = null, $type = null, $id = null) * @param string $name * @param string $type * @param string $id + * @param string $ownerKey * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ - protected function morphEagerTo($name, $type, $id) + protected function morphEagerTo($name, $type, $id, $ownerKey) { return new MorphTo( - $this->newQuery()->setEagerLoads([]), $this, $id, null, $type, $name + $this->newQuery()->setEagerLoads([]), $this, $id, $ownerKey, $type, $name ); } @@ -171,16 +173,17 @@ protected function morphEagerTo($name, $type, $id) * @param string $name * @param string $type * @param string $id + * @param string $ownerKey * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ - protected function morphInstanceTo($target, $name, $type, $id) + protected function morphInstanceTo($target, $name, $type, $id, $ownerKey) { $instance = $this->newRelatedInstance( static::getActualClassNameForMorph($target) ); return new MorphTo( - $instance->newQuery(), $this, $id, $instance->getKeyName(), $type, $name + $instance->newQuery(), $this, $id, $ownerKey ?? $instance->getKeyName(), $type, $name ); } diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index 2739786d5e7e..073b887e8487 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -120,12 +120,14 @@ protected function getResultsByType($type) { $instance = $this->createModelByType($type); + $ownerKey = $this->ownerKey ?? $instance->getKeyName(); + $query = $this->replayMacros($instance->newQuery()) ->mergeConstraintsFrom($this->getQuery()) ->with($this->getQuery()->getEagerLoads()); return $query->whereIn( - $instance->getTable().'.'.$instance->getKeyName(), $this->gatherKeysByType($type) + $instance->getTable().'.'.$ownerKey, $this->gatherKeysByType($type) )->get(); } @@ -178,8 +180,10 @@ public function match(array $models, Collection $results, $relation) protected function matchToMorphParents($type, Collection $results) { foreach ($results as $result) { - if (isset($this->dictionary[$type][$result->getKey()])) { - foreach ($this->dictionary[$type][$result->getKey()] as $model) { + $ownerKey = ! is_null($this->ownerKey) ? $result->{$this->ownerKey} : $result->getKey(); + + if (isset($this->dictionary[$type][$ownerKey])) { + foreach ($this->dictionary[$type][$ownerKey] as $model) { $model->setRelation($this->relation, $result); } } From 0dc4c19e36ed1bbf221b92f33e298f9be3ca3555 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 21 Sep 2017 08:58:56 -0500 Subject: [PATCH 20/66] formatting --- src/Illuminate/Contracts/Queue/Job.php | 28 +++++++++++++------------- src/Illuminate/Queue/Jobs/Job.php | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Illuminate/Contracts/Queue/Job.php b/src/Illuminate/Contracts/Queue/Job.php index 22396fc0044c..98ecf6356673 100644 --- a/src/Illuminate/Contracts/Queue/Job.php +++ b/src/Illuminate/Contracts/Queue/Job.php @@ -4,6 +4,20 @@ interface Job { + /** + * Get the job identifier. + * + * @return string + */ + public function getJobId(); + + /** + * Get the decoded body of the job. + * + * @return array + */ + public function payload(); + /** * Fire the job. * @@ -112,18 +126,4 @@ public function getQueue(); * @return string */ public function getRawBody(); - - /** - * Get the decoded body of the job. - * - * @return array - */ - public function payload(); - - /** - * Get the job identifier. - * - * @return string - */ - public function getJobId(); } diff --git a/src/Illuminate/Queue/Jobs/Job.php b/src/Illuminate/Queue/Jobs/Job.php index 9139332628a7..93a020f53193 100755 --- a/src/Illuminate/Queue/Jobs/Job.php +++ b/src/Illuminate/Queue/Jobs/Job.php @@ -56,18 +56,18 @@ abstract class Job protected $queue; /** - * Get the raw body of the job. + * Get the job identifier. * * @return string */ - abstract public function getRawBody(); + abstract public function getJobId(); /** - * Get the job identifier. + * Get the raw body of the job. * * @return string */ - abstract public function getJobId(); + abstract public function getRawBody(); /** * Fire the job. From 91212dff07d364275358afc1980659867c98123b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 21 Sep 2017 09:39:54 -0500 Subject: [PATCH 21/66] add test --- .../Contracts/Database/ModelIdentifier.php | 18 +++++++-------- .../Contracts/Queue/QueueableCollection.php | 12 +++++----- .../Contracts/Queue/QueueableEntity.php | 12 +++++----- .../Database/Eloquent/Collection.php | 20 ++++++++--------- src/Illuminate/Database/Eloquent/Model.php | 22 +++++++++---------- .../SerializesAndRestoresModelIdentifiers.php | 11 +++++----- .../Queue/ModelSerializationTest.php | 9 ++++++-- 7 files changed, 55 insertions(+), 49 deletions(-) diff --git a/src/Illuminate/Contracts/Database/ModelIdentifier.php b/src/Illuminate/Contracts/Database/ModelIdentifier.php index cdd4b9cc91a2..9893d280ef69 100644 --- a/src/Illuminate/Contracts/Database/ModelIdentifier.php +++ b/src/Illuminate/Contracts/Database/ModelIdentifier.php @@ -21,33 +21,33 @@ class ModelIdentifier public $id; /** - * The connection name of the model. + * The relationships loaded on the model. * - * @var string|null + * @var array */ - public $connection; + public $relations; /** - * The relationships loaded on the model. + * The connection name of the model. * - * @var array + * @var string|null */ - public $relations; + public $connection; /** * Create a new model identifier. * * @param string $class * @param mixed $id - * @param mixed $connection * @param array $relations + * @param mixed $connection * @return void */ - public function __construct($class, $id, $connection, $relations) + public function __construct($class, $id, array $relations, $connection) { $this->id = $id; $this->class = $class; - $this->connection = $connection; $this->relations = $relations; + $this->connection = $connection; } } diff --git a/src/Illuminate/Contracts/Queue/QueueableCollection.php b/src/Illuminate/Contracts/Queue/QueueableCollection.php index a26fa57ab4d3..7f1ea19c5436 100644 --- a/src/Illuminate/Contracts/Queue/QueueableCollection.php +++ b/src/Illuminate/Contracts/Queue/QueueableCollection.php @@ -19,16 +19,16 @@ public function getQueueableClass(); public function getQueueableIds(); /** - * Get the connection of the entities being queued. + * Get the relationships of the entities being queued. * - * @return string|null + * @return array */ - public function getQueueableConnection(); + public function getQueueableRelations(); /** - * Get the relationships of the entities being queued. + * Get the connection of the entities being queued. * - * @return array + * @return string|null */ - public function getQueueableRelations(); + public function getQueueableConnection(); } diff --git a/src/Illuminate/Contracts/Queue/QueueableEntity.php b/src/Illuminate/Contracts/Queue/QueueableEntity.php index 2388e1e2183c..366f0c84fab6 100644 --- a/src/Illuminate/Contracts/Queue/QueueableEntity.php +++ b/src/Illuminate/Contracts/Queue/QueueableEntity.php @@ -12,16 +12,16 @@ interface QueueableEntity public function getQueueableId(); /** - * Get the connection of the entity. + * Get the relationships for the entity. * - * @return string|null + * @return array */ - public function getQueueableConnection(); + public function getQueueableRelations(); /** - * Get the relationships for the entity. + * Get the connection of the entity. * - * @return array + * @return string|null */ - public function getQueueableRelations(); + public function getQueueableConnection(); } diff --git a/src/Illuminate/Database/Eloquent/Collection.php b/src/Illuminate/Database/Eloquent/Collection.php index 58380afb9362..503bccb3a570 100755 --- a/src/Illuminate/Database/Eloquent/Collection.php +++ b/src/Illuminate/Database/Eloquent/Collection.php @@ -398,6 +398,16 @@ public function getQueueableIds() return $this->modelKeys(); } + /** + * Get the relationships of the entities being queued. + * + * @return array + */ + public function getQueueableRelations() + { + return $this->isNotEmpty() ? $this->first()->getRelations() : []; + } + /** * Get the connection of the entities being queued. * @@ -420,14 +430,4 @@ public function getQueueableConnection() return $connection; } - - /** - * Get the relationships of the entities being queued. - * - * @return array - */ - public function getQueueableRelations() - { - return $this->isNotEmpty() ? $this->first()->getRelations() : []; - } } diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index aa277345d14b..f68ebbdd6174 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -1237,16 +1237,6 @@ public function getQueueableId() return $this->getKey(); } - /** - * Get the queueable connection for the entity. - * - * @return mixed - */ - public function getQueueableConnection() - { - return $this->getConnectionName(); - } - /** * Get the queueable relationships for the entity. * @@ -1272,7 +1262,17 @@ public function getQueueableRelations() } } - return $relations; + return array_unique($relations); + } + + /** + * Get the queueable connection for the entity. + * + * @return mixed + */ + public function getQueueableConnection() + { + return $this->getConnectionName(); } /** diff --git a/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php b/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php index e90a0b8ea3b3..9dff64495c99 100644 --- a/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php +++ b/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php @@ -21,8 +21,8 @@ protected function getSerializedPropertyValue($value) return new ModelIdentifier( $value->getQueueableClass(), $value->getQueueableIds(), - $value->getQueueableConnection(), - $value->getQueueableRelations() + $value->getQueueableRelations(), + $value->getQueueableConnection() ); } @@ -30,8 +30,8 @@ protected function getSerializedPropertyValue($value) return new ModelIdentifier( get_class($value), $value->getQueueableId(), - $value->getQueueableConnection(), - $value->getQueueableRelations() + $value->getQueueableRelations(), + $value->getQueueableConnection() ); } @@ -79,7 +79,8 @@ protected function restoreCollection($value) */ public function restoreModel($value) { - $model = $this->getQueryForModelRestoration((new $value->class)->setConnection($value->connection)) + $model = $this->getQueryForModelRestoration((new $value->class) + ->setConnection($value->connection)) ->useWritePdo()->findOrFail($value->id); return $model->load($value->relations); diff --git a/tests/Integration/Queue/ModelSerializationTest.php b/tests/Integration/Queue/ModelSerializationTest.php index 89b3b89ffbc9..fd72abe87809 100644 --- a/tests/Integration/Queue/ModelSerializationTest.php +++ b/tests/Integration/Queue/ModelSerializationTest.php @@ -154,7 +154,7 @@ public function it_reloads_relationships() Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); Line::create(['order_id' => $order->id, 'product_id' => $product2->id]); - $order->load('lines'); + $order->load('line', 'lines'); $serialized = serialize(new ModelRelationSerializationTestClass($order)); $unSerialized = unserialize($serialized); @@ -175,7 +175,7 @@ public function it_reloads_nested_relationships() Line::create(['order_id' => $order->id, 'product_id' => $product1->id]); Line::create(['order_id' => $order->id, 'product_id' => $product2->id]); - $order->load('lines', 'lines.product'); + $order->load('line.product', 'lines', 'lines.product'); $nestedSerialized = serialize(new ModelRelationSerializationTestClass($order)); $nestedUnSerialized = unserialize($nestedSerialized); @@ -196,6 +196,11 @@ class Order extends Model public $guarded = ['id']; public $timestamps = false; + public function line() + { + return $this->hasOne(Line::class); + } + public function lines() { return $this->hasMany(Line::class); From c5d02773392041b28dec8855aeee85246b8d7d17 Mon Sep 17 00:00:00 2001 From: Mohamed-Elwan Date: Tue, 26 Sep 2017 00:23:19 +0200 Subject: [PATCH 22/66] Add the batch number to migrate:status command --- .../Database/Console/Migrations/StatusCommand.php | 12 +++++++----- .../Migrations/DatabaseMigrationRepository.php | 13 +++++++++++++ .../Migrations/MigrationRepositoryInterface.php | 7 +++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Database/Console/Migrations/StatusCommand.php b/src/Illuminate/Database/Console/Migrations/StatusCommand.php index 6cdea01faa75..6d38e350921f 100644 --- a/src/Illuminate/Database/Console/Migrations/StatusCommand.php +++ b/src/Illuminate/Database/Console/Migrations/StatusCommand.php @@ -56,9 +56,10 @@ public function handle() } $ran = $this->migrator->getRepository()->getRan(); + $migrationsBatches = $this->migrator->getRepository()->getMigrationsBatches(); - if (count($migrations = $this->getStatusFor($ran)) > 0) { - $this->table(['Ran?', 'Migration'], $migrations); + if (count($migrations = $this->getStatusFor($ran, $migrationsBatches)) > 0) { + $this->table(['Ran?', 'Migration', 'Batch'], $migrations); } else { $this->error('No migrations found'); } @@ -68,16 +69,17 @@ public function handle() * Get the status for the given ran migrations. * * @param array $ran + * @param array $migrationsBatches * @return \Illuminate\Support\Collection */ - protected function getStatusFor(array $ran) + protected function getStatusFor(array $ran, array $migrationsBatches) { return Collection::make($this->getAllMigrationFiles()) - ->map(function ($migration) use ($ran) { + ->map(function ($migration) use ($ran, $migrationsBatches) { $migrationName = $this->migrator->getMigrationName($migration); return in_array($migrationName, $ran) - ? ['Y', $migrationName] + ? ['Y', $migrationName, $migrationsBatches[$migrationName]] : ['N', $migrationName]; }); } diff --git a/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php b/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php index b1685ffa3524..e438f8e6d764 100755 --- a/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php +++ b/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php @@ -53,6 +53,19 @@ public function getRan() ->pluck('migration')->all(); } + /** + * Get the ran migrations with batch numbers. + * + * @return array + */ + public function getMigrationsBatches() + { + return $this->table() + ->orderBy('batch', 'asc') + ->orderBy('migration', 'asc') + ->pluck('batch', 'migration')->all(); + } + /** * Get list of migrations. * diff --git a/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php b/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php index 60bc921f8931..88b942d100cb 100755 --- a/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php +++ b/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php @@ -11,6 +11,13 @@ interface MigrationRepositoryInterface */ public function getRan(); + /** + * Get the ran migrations with batch numbers for a given package. + * + * @return array + */ + public function getMigrationsBatches(); + /** * Get list of migrations. * From a3f5b1952624e175efb07c3a2acff6a0f263bccc Mon Sep 17 00:00:00 2001 From: Toby Evans Date: Wed, 27 Sep 2017 01:31:28 +1300 Subject: [PATCH 23/66] [5.6] Ignore svg's in validateDimensions() (#21390) * Ignore svg's in validateDimensions() SVG dimensions are pretty irrelevant, so they should simply pass this test. * Change svg test to check for mime instead of ext in validateDimensions() --- src/Illuminate/Validation/Concerns/ValidatesAttributes.php | 4 ++++ tests/Validation/ValidationValidatorTest.php | 7 +++++++ tests/Validation/fixtures/image.svg | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 tests/Validation/fixtures/image.svg diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index e4bcd813425f..af5e2f2e18fb 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -447,6 +447,10 @@ public function validateDigitsBetween($attribute, $value, $parameters) */ public function validateDimensions($attribute, $value, $parameters) { + if ($this->isValidFileInstance($value) && $value->getClientMimeType() == 'image/svg+xml') { + return true; + } + if (! $this->isValidFileInstance($value) || ! $sizeDetails = @getimagesize($value->getRealPath())) { return false; } diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index 49469bd5498c..8738253d0467 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -2102,6 +2102,13 @@ public function testValidateImageDimensions() // Ensure validation doesn't erroneously fail when ratio has no fractional part $v = new Validator($trans, ['x' => $uploadedFile], ['x' => 'dimensions:ratio=2/3']); $this->assertTrue($v->passes()); + + // Ensure svg images always pass as size is irreleveant + $uploadedFile = new \Symfony\Component\HttpFoundation\File\UploadedFile(__DIR__.'/fixtures/image.svg', '', 'image/svg+xml', null, null, true); + $trans = $this->getIlluminateArrayTranslator(); + + $v = new Validator($trans, ['x' => $uploadedFile], ['x' => 'dimensions:max_width=1,max_height=1']); + $this->assertTrue($v->passes()); } /** diff --git a/tests/Validation/fixtures/image.svg b/tests/Validation/fixtures/image.svg new file mode 100644 index 000000000000..9a55b678ffb5 --- /dev/null +++ b/tests/Validation/fixtures/image.svg @@ -0,0 +1,2 @@ + + From fa9515ebf40a38585b2d8eb14c2fb4b19ba518b5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 2 Oct 2017 09:39:47 -0500 Subject: [PATCH 24/66] formatting --- .../Console/Migrations/StatusCommand.php | 13 ++++---- .../DatabaseMigrationRepository.php | 30 +++++++++---------- .../MigrationRepositoryInterface.php | 18 +++++------ 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/Illuminate/Database/Console/Migrations/StatusCommand.php b/src/Illuminate/Database/Console/Migrations/StatusCommand.php index 6d38e350921f..4cec4dd61f1c 100644 --- a/src/Illuminate/Database/Console/Migrations/StatusCommand.php +++ b/src/Illuminate/Database/Console/Migrations/StatusCommand.php @@ -56,9 +56,10 @@ public function handle() } $ran = $this->migrator->getRepository()->getRan(); - $migrationsBatches = $this->migrator->getRepository()->getMigrationsBatches(); - if (count($migrations = $this->getStatusFor($ran, $migrationsBatches)) > 0) { + $batches = $this->migrator->getRepository()->getMigrationBatches(); + + if (count($migrations = $this->getStatusFor($ran, $batches)) > 0) { $this->table(['Ran?', 'Migration', 'Batch'], $migrations); } else { $this->error('No migrations found'); @@ -69,17 +70,17 @@ public function handle() * Get the status for the given ran migrations. * * @param array $ran - * @param array $migrationsBatches + * @param array $batches * @return \Illuminate\Support\Collection */ - protected function getStatusFor(array $ran, array $migrationsBatches) + protected function getStatusFor(array $ran, array $batches) { return Collection::make($this->getAllMigrationFiles()) - ->map(function ($migration) use ($ran, $migrationsBatches) { + ->map(function ($migration) use ($ran, $batches) { $migrationName = $this->migrator->getMigrationName($migration); return in_array($migrationName, $ran) - ? ['Y', $migrationName, $migrationsBatches[$migrationName]] + ? ['Y', $migrationName, $batches[$migrationName]] : ['N', $migrationName]; }); } diff --git a/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php b/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php index e438f8e6d764..1ace1a6ff7e3 100755 --- a/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php +++ b/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php @@ -41,7 +41,7 @@ public function __construct(Resolver $resolver, $table) } /** - * Get the ran migrations. + * Get the completed migrations. * * @return array */ @@ -53,19 +53,6 @@ public function getRan() ->pluck('migration')->all(); } - /** - * Get the ran migrations with batch numbers. - * - * @return array - */ - public function getMigrationsBatches() - { - return $this->table() - ->orderBy('batch', 'asc') - ->orderBy('migration', 'asc') - ->pluck('batch', 'migration')->all(); - } - /** * Get list of migrations. * @@ -93,11 +80,24 @@ public function getLast() return $query->orderBy('migration', 'desc')->get()->all(); } + /** + * Get the completed migrations with their batch numbers. + * + * @return array + */ + public function getMigrationBatches() + { + return $this->table() + ->orderBy('batch', 'asc') + ->orderBy('migration', 'asc') + ->pluck('batch', 'migration')->all(); + } + /** * Log that a migration was run. * * @param string $file - * @param int $batch + * @param int $batch * @return void */ public function log($file, $batch) diff --git a/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php b/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php index 88b942d100cb..410326a9bd68 100755 --- a/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php +++ b/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php @@ -5,19 +5,12 @@ interface MigrationRepositoryInterface { /** - * Get the ran migrations for a given package. + * Get the completed migrations. * * @return array */ public function getRan(); - /** - * Get the ran migrations with batch numbers for a given package. - * - * @return array - */ - public function getMigrationsBatches(); - /** * Get list of migrations. * @@ -33,11 +26,18 @@ public function getMigrations($steps); */ public function getLast(); + /** + * Get the completed migrations with their batch numbers. + * + * @return array + */ + public function getMigrationBatches(); + /** * Log that a migration was run. * * @param string $file - * @param int $batch + * @param int $batch * @return void */ public function log($file, $batch); From 5ce5b6a38fb07ae80d994cfaa072a288c7b74cc0 Mon Sep 17 00:00:00 2001 From: Dylan DPC Date: Fri, 6 Oct 2017 18:40:32 +0530 Subject: [PATCH 25/66] [5.6] make() signature in contract matches implementation (#21553) * make method signature in contract matches implementation * forever() method matched to implementation --- src/Illuminate/Contracts/Cookie/Factory.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Contracts/Cookie/Factory.php b/src/Illuminate/Contracts/Cookie/Factory.php index 6124397658ea..0cf83ea7f08a 100644 --- a/src/Illuminate/Contracts/Cookie/Factory.php +++ b/src/Illuminate/Contracts/Cookie/Factory.php @@ -14,9 +14,11 @@ interface Factory * @param string $domain * @param bool $secure * @param bool $httpOnly + * @param bool $raw + * @param string|null $sameSite * @return \Symfony\Component\HttpFoundation\Cookie */ - public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true); + public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true, $raw = false, $sameSite = null); /** * Create a cookie that lasts "forever" (five years). @@ -27,9 +29,11 @@ public function make($name, $value, $minutes = 0, $path = null, $domain = null, * @param string $domain * @param bool $secure * @param bool $httpOnly + * @param bool $raw + * @param string|null $sameSite * @return \Symfony\Component\HttpFoundation\Cookie */ - public function forever($name, $value, $path = null, $domain = null, $secure = false, $httpOnly = true); + public function forever($name, $value, $path = null, $domain = null, $secure = false, $httpOnly = true, $raw = false, $sameSite = null); /** * Expire the given cookie. From 07d160ac3cc9764d5b429734ffce4fa311385403 Mon Sep 17 00:00:00 2001 From: dragonmantank Date: Fri, 13 Oct 2017 08:38:57 -0400 Subject: [PATCH 26/66] [5.6] Updated to use new release of cron-expression (#21637) * Updated to use new release of cron-expression * fix test --- composer.json | 2 +- src/Illuminate/Console/Scheduling/Event.php | 2 +- tests/Console/ConsoleScheduledEventTest.php | 12 +++--- tests/Console/Scheduling/EventTest.php | 2 +- tests/Console/Scheduling/FrequencyTest.php | 44 ++++++++++----------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index 08513c601287..c25742872988 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "erusev/parsedown": "~1.6", "league/flysystem": "~1.0", "monolog/monolog": "~1.12", - "mtdowling/cron-expression": "~1.0", + "dragonmantank/cron-expression": "~2.0", "nesbot/carbon": "~1.20", "psr/container": "~1.0", "psr/simple-cache": "^1.0", diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 4d67c4789501..ba5ff56eb36c 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -27,7 +27,7 @@ class Event * * @var string */ - public $expression = '* * * * * *'; + public $expression = '* * * * *'; /** * The timezone the date should be evaluated on. diff --git a/tests/Console/ConsoleScheduledEventTest.php b/tests/Console/ConsoleScheduledEventTest.php index 7fe250ce4dc4..ddd3b9b95170 100644 --- a/tests/Console/ConsoleScheduledEventTest.php +++ b/tests/Console/ConsoleScheduledEventTest.php @@ -36,7 +36,7 @@ public function testBasicCronCompilation() $app->shouldReceive('environment')->andReturn('production'); $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); - $this->assertEquals('* * * * * *', $event->getExpression()); + $this->assertEquals('* * * * *', $event->getExpression()); $this->assertTrue($event->isDue($app)); $this->assertTrue($event->skip(function () { return true; @@ -46,17 +46,17 @@ public function testBasicCronCompilation() })->filtersPass($app)); $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); - $this->assertEquals('* * * * * *', $event->getExpression()); + $this->assertEquals('* * * * *', $event->getExpression()); $this->assertFalse($event->environments('local')->isDue($app)); $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); - $this->assertEquals('* * * * * *', $event->getExpression()); + $this->assertEquals('* * * * *', $event->getExpression()); $this->assertFalse($event->when(function () { return false; })->filtersPass($app)); $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); - $this->assertEquals('* * * * * *', $event->getExpression()); + $this->assertEquals('* * * * *', $event->getExpression()); $this->assertFalse($event->when(false)->filtersPass($app)); // chained rules should be commutative @@ -81,11 +81,11 @@ public function testEventIsDueCheck() Carbon::setTestNow(Carbon::create(2015, 1, 1, 0, 0, 0)); $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); - $this->assertEquals('* * * * 4 *', $event->thursdays()->getExpression()); + $this->assertEquals('* * * * 4', $event->thursdays()->getExpression()); $this->assertTrue($event->isDue($app)); $event = new Event(m::mock('Illuminate\Console\Scheduling\Mutex'), 'php foo'); - $this->assertEquals('0 19 * * 3 *', $event->wednesdays()->at('19:00')->timezone('EST')->getExpression()); + $this->assertEquals('0 19 * * 3', $event->wednesdays()->at('19:00')->timezone('EST')->getExpression()); $this->assertTrue($event->isDue($app)); } diff --git a/tests/Console/Scheduling/EventTest.php b/tests/Console/Scheduling/EventTest.php index af9b0d382ecf..bc3e9df29509 100644 --- a/tests/Console/Scheduling/EventTest.php +++ b/tests/Console/Scheduling/EventTest.php @@ -28,7 +28,7 @@ public function testBuildCommand() $event->runInBackground(); $defaultOutput = (DIRECTORY_SEPARATOR == '\\') ? 'NUL' : '/dev/null'; - $this->assertSame("(php -i > {$quote}{$defaultOutput}{$quote} 2>&1 ; '".PHP_BINARY."' artisan schedule:finish \"framework/schedule-c65b1c374c37056e0c57fccb0c08d724ce6f5043\") > {$quote}{$defaultOutput}{$quote} 2>&1 &", $event->buildCommand()); + $this->assertSame("(php -i > {$quote}{$defaultOutput}{$quote} 2>&1 ; '".PHP_BINARY."' artisan schedule:finish \"framework/schedule-eeb46c93d45e928d62aaf684d727e213b7094822\") > {$quote}{$defaultOutput}{$quote} 2>&1 &", $event->buildCommand()); } public function testBuildCommandSendOutputTo() diff --git a/tests/Console/Scheduling/FrequencyTest.php b/tests/Console/Scheduling/FrequencyTest.php index 8a12a7940263..e9738115c337 100644 --- a/tests/Console/Scheduling/FrequencyTest.php +++ b/tests/Console/Scheduling/FrequencyTest.php @@ -23,99 +23,99 @@ public function setUp() public function testEveryMinute() { - $this->assertEquals('* * * * * *', $this->event->getExpression()); - $this->assertEquals('* * * * * *', $this->event->everyMinute()->getExpression()); + $this->assertEquals('* * * * *', $this->event->getExpression()); + $this->assertEquals('* * * * *', $this->event->everyMinute()->getExpression()); } public function testEveryFiveMinutes() { - $this->assertEquals('*/5 * * * * *', $this->event->everyFiveMinutes()->getExpression()); + $this->assertEquals('*/5 * * * *', $this->event->everyFiveMinutes()->getExpression()); } public function testDaily() { - $this->assertEquals('0 0 * * * *', $this->event->daily()->getExpression()); + $this->assertEquals('0 0 * * *', $this->event->daily()->getExpression()); } public function testTwiceDaily() { - $this->assertEquals('0 3,15 * * * *', $this->event->twiceDaily(3, 15)->getExpression()); + $this->assertEquals('0 3,15 * * *', $this->event->twiceDaily(3, 15)->getExpression()); } public function testOverrideWithHourly() { - $this->assertEquals('0 * * * * *', $this->event->everyFiveMinutes()->hourly()->getExpression()); - $this->assertEquals('37 * * * * *', $this->event->hourlyAt(37)->getExpression()); + $this->assertEquals('0 * * * *', $this->event->everyFiveMinutes()->hourly()->getExpression()); + $this->assertEquals('37 * * * *', $this->event->hourlyAt(37)->getExpression()); } public function testMonthlyOn() { - $this->assertEquals('0 15 4 * * *', $this->event->monthlyOn(4, '15:00')->getExpression()); + $this->assertEquals('0 15 4 * *', $this->event->monthlyOn(4, '15:00')->getExpression()); } public function testTwiceMonthly() { - $this->assertEquals('0 0 1,16 * * *', $this->event->twiceMonthly(1, 16)->getExpression()); + $this->assertEquals('0 0 1,16 * *', $this->event->twiceMonthly(1, 16)->getExpression()); } public function testMonthlyOnWithMinutes() { - $this->assertEquals('15 15 4 * * *', $this->event->monthlyOn(4, '15:15')->getExpression()); + $this->assertEquals('15 15 4 * *', $this->event->monthlyOn(4, '15:15')->getExpression()); } public function testWeekdaysDaily() { - $this->assertEquals('0 0 * * 1-5 *', $this->event->weekdays()->daily()->getExpression()); + $this->assertEquals('0 0 * * 1-5', $this->event->weekdays()->daily()->getExpression()); } public function testWeekdaysHourly() { - $this->assertEquals('0 * * * 1-5 *', $this->event->weekdays()->hourly()->getExpression()); + $this->assertEquals('0 * * * 1-5', $this->event->weekdays()->hourly()->getExpression()); } public function testWeekdays() { - $this->assertEquals('* * * * 1-5 *', $this->event->weekdays()->getExpression()); + $this->assertEquals('* * * * 1-5', $this->event->weekdays()->getExpression()); } public function testSundays() { - $this->assertEquals('* * * * 0 *', $this->event->sundays()->getExpression()); + $this->assertEquals('* * * * 0', $this->event->sundays()->getExpression()); } public function testMondays() { - $this->assertEquals('* * * * 1 *', $this->event->mondays()->getExpression()); + $this->assertEquals('* * * * 1', $this->event->mondays()->getExpression()); } public function testTuesdays() { - $this->assertEquals('* * * * 2 *', $this->event->tuesdays()->getExpression()); + $this->assertEquals('* * * * 2', $this->event->tuesdays()->getExpression()); } public function testWednesdays() { - $this->assertEquals('* * * * 3 *', $this->event->wednesdays()->getExpression()); + $this->assertEquals('* * * * 3', $this->event->wednesdays()->getExpression()); } public function testThursdays() { - $this->assertEquals('* * * * 4 *', $this->event->thursdays()->getExpression()); + $this->assertEquals('* * * * 4', $this->event->thursdays()->getExpression()); } public function testFridays() { - $this->assertEquals('* * * * 5 *', $this->event->fridays()->getExpression()); + $this->assertEquals('* * * * 5', $this->event->fridays()->getExpression()); } public function testSaturdays() { - $this->assertEquals('* * * * 6 *', $this->event->saturdays()->getExpression()); + $this->assertEquals('* * * * 6', $this->event->saturdays()->getExpression()); } public function testQuarterly() { - $this->assertEquals('0 0 1 1-12/3 * *', $this->event->quarterly()->getExpression()); + $this->assertEquals('0 0 1 1-12/3 *', $this->event->quarterly()->getExpression()); } public function testFrequencyMacro() @@ -124,6 +124,6 @@ public function testFrequencyMacro() return $this->spliceIntoPosition(1, "*/{$x}"); }); - $this->assertEquals('*/6 * * * * *', $this->event->everyXMinutes(6)->getExpression()); + $this->assertEquals('*/6 * * * *', $this->event->everyXMinutes(6)->getExpression()); } } From bc54efd9129430f7b2333e903ef7ab6099171418 Mon Sep 17 00:00:00 2001 From: Mathieu TUDISCO Date: Fri, 13 Oct 2017 14:44:58 +0200 Subject: [PATCH 27/66] Return 201 in case of a Model just created. (#21625) --- src/Illuminate/Routing/Router.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index 284226097f0f..ff04e03e237d 100644 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -11,6 +11,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; use Illuminate\Container\Container; +use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Traits\Macroable; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Events\Dispatcher; @@ -700,6 +701,8 @@ public static function toResponse($request, $response) if ($response instanceof PsrResponseInterface) { $response = (new HttpFoundationFactory)->createResponse($response); + } elseif ($response instanceof Model && $response->wasRecentlyCreated) { + $response = new JsonResponse($response, 201); } elseif (! $response instanceof SymfonyResponse && ($response instanceof Arrayable || $response instanceof Jsonable || From d15ad0fdf2d1fef63600eeccf57d756d28571614 Mon Sep 17 00:00:00 2001 From: eddiclin Date: Tue, 17 Oct 2017 21:16:51 +0800 Subject: [PATCH 28/66] swap the index order of morph type and id (#21693) It can be utilize the index when query the type by using "WHERE type = ?", also "WHERE type IN (?)" --- src/Illuminate/Database/Schema/Blueprint.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index a46ecd2c0d2b..9c5304208fed 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -1033,11 +1033,11 @@ public function multiPolygon($column) */ public function morphs($name, $indexName = null) { - $this->unsignedInteger("{$name}_id"); - $this->string("{$name}_type"); - $this->index(["{$name}_id", "{$name}_type"], $indexName); + $this->unsignedInteger("{$name}_id"); + + $this->index(["{$name}_type", "{$name}_id"], $indexName); } /** @@ -1049,11 +1049,11 @@ public function morphs($name, $indexName = null) */ public function nullableMorphs($name, $indexName = null) { - $this->unsignedInteger("{$name}_id")->nullable(); - $this->string("{$name}_type")->nullable(); - $this->index(["{$name}_id", "{$name}_type"], $indexName); + $this->unsignedInteger("{$name}_id")->nullable(); + + $this->index(["{$name}_type", "{$name}_id"], $indexName); } /** From ad2374b435a1fdf02fd19a57e52175cb844d4498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Wed, 18 Oct 2017 08:22:13 -0700 Subject: [PATCH 29/66] update v5.6 changelog --- CHANGELOG-5.6.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-5.6.md b/CHANGELOG-5.6.md index 2b8a76a67d47..6828766b6cf6 100644 --- a/CHANGELOG-5.6.md +++ b/CHANGELOG-5.6.md @@ -3,7 +3,27 @@ ## [Unreleased] ### General -- Added `runningUnitTests()` to `Application` contract ([#21034](https://github.com/laravel/framework/pull/21034)) +- ⚠️ Added `runningUnitTests()` to `Application` contract ([#21034](https://github.com/laravel/framework/pull/21034)) +- ⚠️ Upgraded `cron-expression` to `2.x` ([#21637](https://github.com/laravel/framework/pull/21637)) ### Artisan Console -- Removed deprecated `optimize` command ([#20851](https://github.com/laravel/framework/pull/20851)) +- ⚠️ Removed deprecated `optimize` command ([#20851](https://github.com/laravel/framework/pull/20851)) +- Show job id in `queue:work` output ([#21204](https://github.com/laravel/framework/pull/21204)) +- Show batch number in `migrate:status` output ([#21391](https://github.com/laravel/framework/pull/21391)) + +### Database +- ⚠️ Swap the index order of morph type and id ([#21693](https://github.com/laravel/framework/pull/21693)) + +### Eloquent +- Serialize relationships ([#21229](https://github.com/laravel/framework/pull/21229)) +- Allow setting custom owner key on polymorphic relationships ([#21310](https://github.com/laravel/framework/pull/21310)) + +### Queues +- ⚠️ Added `payload()` and `getJobId()` to `Job` contract ([#21303](https://github.com/laravel/framework/pull/21303)) + +### Responses +- Added missing `$raw` and `$sameSite` parameters to `Cookie\Factory` methods ([#21553](https://github.com/laravel/framework/pull/21553)) +- ⚠️ Return `201` status of Model was recently created ([#21625](https://github.com/laravel/framework/pull/21625)) + +### Validation +- ⚠️ Ignore SVGs in `validateDimensions()` ([#21390](https://github.com/laravel/framework/pull/21390)) From b345fdf8da127fa78fdd24673261e9b38e95208c Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Thu, 19 Oct 2017 14:43:54 +0200 Subject: [PATCH 30/66] [5.6] Let Arr::wrap(null) return empty array (#21745) * Let Arr::wrap(null) return empty array * Fix comment * Update Arr.php --- src/Illuminate/Support/Arr.php | 6 +++++- tests/Support/SupportArrTest.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Support/Arr.php b/src/Illuminate/Support/Arr.php index a9e09ce81287..df9f8a142eee 100755 --- a/src/Illuminate/Support/Arr.php +++ b/src/Illuminate/Support/Arr.php @@ -594,13 +594,17 @@ public static function where($array, callable $callback) } /** - * If the given value is not an array, wrap it in one. + * If the given value is not an array and not null, wrap it in one. * * @param mixed $value * @return array */ public static function wrap($value) { + if (is_null($value)) { + return []; + } + return ! is_array($value) ? [$value] : $value; } } diff --git a/tests/Support/SupportArrTest.php b/tests/Support/SupportArrTest.php index 794e9de2e46a..90644d9a5474 100644 --- a/tests/Support/SupportArrTest.php +++ b/tests/Support/SupportArrTest.php @@ -662,5 +662,6 @@ public function testWrap() $this->assertEquals(['a'], Arr::wrap($string)); $this->assertEquals($array, Arr::wrap($array)); $this->assertEquals([$object], Arr::wrap($object)); + $this->assertEquals([], Arr::wrap(null)); } } From 5dfc932d4b504c89e12e0276563c2dc18a7cc361 Mon Sep 17 00:00:00 2001 From: Joaquin Marcher Date: Thu, 19 Oct 2017 18:01:58 +0200 Subject: [PATCH 31/66] [5.6] Added Arr::wrap(null) change to changelog (#21750) * Added Arr::wrap(null) change to changelog * Update CHANGELOG-5.6.md --- CHANGELOG-5.6.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG-5.6.md b/CHANGELOG-5.6.md index 6828766b6cf6..39034332ab42 100644 --- a/CHANGELOG-5.6.md +++ b/CHANGELOG-5.6.md @@ -6,6 +6,9 @@ - ⚠️ Added `runningUnitTests()` to `Application` contract ([#21034](https://github.com/laravel/framework/pull/21034)) - ⚠️ Upgraded `cron-expression` to `2.x` ([#21637](https://github.com/laravel/framework/pull/21637)) +### Arrays +- ⚠️ Arr::wrap(null) will now return an empty array instead of wrapping the null value ([#21745](https://github.com/laravel/framework/pull/21745)) + ### Artisan Console - ⚠️ Removed deprecated `optimize` command ([#20851](https://github.com/laravel/framework/pull/20851)) - Show job id in `queue:work` output ([#21204](https://github.com/laravel/framework/pull/21204)) From a24e0a8e6cdead2df7763bd4a9654c1d1e9bbf7d Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Tue, 24 Oct 2017 15:06:46 -0500 Subject: [PATCH 32/66] Adding message data to mail sending and sent events --- src/Illuminate/Mail/Events/MessageSending.php | 13 +++++++++++-- src/Illuminate/Mail/Events/MessageSent.php | 11 ++++++++++- src/Illuminate/Mail/Mailer.php | 14 ++++++++------ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/Illuminate/Mail/Events/MessageSending.php b/src/Illuminate/Mail/Events/MessageSending.php index 17bc25731dba..c9482542271c 100644 --- a/src/Illuminate/Mail/Events/MessageSending.php +++ b/src/Illuminate/Mail/Events/MessageSending.php @@ -4,6 +4,13 @@ class MessageSending { + /** + * The message data. + * + * @var array + */ + public $data; + /** * The Swift message instance. * @@ -14,11 +21,13 @@ class MessageSending /** * Create a new event instance. * - * @param \Swift_Message $message + * @param \Swift_Message $message + * @param array $data * @return void */ - public function __construct($message) + public function __construct($message, $data = []) { $this->message = $message; + $this->data = $data; } } diff --git a/src/Illuminate/Mail/Events/MessageSent.php b/src/Illuminate/Mail/Events/MessageSent.php index 8af4a0e93388..50973d81aad2 100644 --- a/src/Illuminate/Mail/Events/MessageSent.php +++ b/src/Illuminate/Mail/Events/MessageSent.php @@ -4,6 +4,13 @@ class MessageSent { + /** + * The message data. + * + * @var array + */ + public $data; + /** * The Swift message instance. * @@ -15,10 +22,12 @@ class MessageSent * Create a new event instance. * * @param \Swift_Message $message + * @param array $data * @return void */ - public function __construct($message) + public function __construct($message, $data = []) { $this->message = $message; + $this->data = $data; } } diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index f6508bc8744b..660834a14f27 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -231,10 +231,10 @@ public function send($view, array $data = [], $callback = null) // its recipients. We will then fire the sent event for the sent message. $swiftMessage = $message->getSwiftMessage(); - if ($this->shouldSendMessage($swiftMessage)) { + if ($this->shouldSendMessage($swiftMessage, $data)) { $this->sendSwiftMessage($swiftMessage); - $this->dispatchSentEvent($message); + $this->dispatchSentEvent($message, $data); } } @@ -458,16 +458,17 @@ protected function sendSwiftMessage($message) * Determines if the message can be sent. * * @param \Swift_Message $message + * @param array $data * @return bool */ - protected function shouldSendMessage($message) + protected function shouldSendMessage($message, $data = []) { if (! $this->events) { return true; } return $this->events->until( - new Events\MessageSending($message) + new Events\MessageSending($message, $data) ) !== false; } @@ -475,13 +476,14 @@ protected function shouldSendMessage($message) * Dispatch the message sent event. * * @param \Illuminate\Mail\Message $message + * @param array $data * @return void */ - protected function dispatchSentEvent($message) + protected function dispatchSentEvent($message, $data = []) { if ($this->events) { $this->events->dispatch( - new Events\MessageSent($message->getSwiftMessage()) + new Events\MessageSent($message->getSwiftMessage(), $data) ); } } From 9df78e897445d40cdaa86e79284decab0cecde4a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Oct 2017 07:24:20 -0500 Subject: [PATCH 33/66] formatting --- src/Illuminate/Mail/Events/MessageSending.php | 16 ++++++++-------- src/Illuminate/Mail/Events/MessageSent.php | 17 +++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/Illuminate/Mail/Events/MessageSending.php b/src/Illuminate/Mail/Events/MessageSending.php index c9482542271c..cff45213b2ae 100644 --- a/src/Illuminate/Mail/Events/MessageSending.php +++ b/src/Illuminate/Mail/Events/MessageSending.php @@ -5,29 +5,29 @@ class MessageSending { /** - * The message data. + * The Swift message instance. * - * @var array + * @var \Swift_Message */ - public $data; + public $message; /** - * The Swift message instance. + * The message data. * - * @var \Swift_Message + * @var array */ - public $message; + public $data; /** * Create a new event instance. * * @param \Swift_Message $message - * @param array $data + * @param array $data * @return void */ public function __construct($message, $data = []) { - $this->message = $message; $this->data = $data; + $this->message = $message; } } diff --git a/src/Illuminate/Mail/Events/MessageSent.php b/src/Illuminate/Mail/Events/MessageSent.php index 50973d81aad2..b0b504c232b3 100644 --- a/src/Illuminate/Mail/Events/MessageSent.php +++ b/src/Illuminate/Mail/Events/MessageSent.php @@ -4,12 +4,6 @@ class MessageSent { - /** - * The message data. - * - * @var array - */ - public $data; /** * The Swift message instance. @@ -18,16 +12,23 @@ class MessageSent */ public $message; + /** + * The message data. + * + * @var array + */ + public $data; + /** * Create a new event instance. * * @param \Swift_Message $message - * @param array $data + * @param array $data * @return void */ public function __construct($message, $data = []) { - $this->message = $message; $this->data = $data; + $this->message = $message; } } From 805ec49e2d1072fdc4a687743d94ba5ba49bae9e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 25 Oct 2017 07:25:01 -0500 Subject: [PATCH 34/66] Apply fixes from StyleCI (#21811) --- src/Illuminate/Mail/Events/MessageSent.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Illuminate/Mail/Events/MessageSent.php b/src/Illuminate/Mail/Events/MessageSent.php index b0b504c232b3..9dee09c2f73c 100644 --- a/src/Illuminate/Mail/Events/MessageSent.php +++ b/src/Illuminate/Mail/Events/MessageSent.php @@ -4,7 +4,6 @@ class MessageSent { - /** * The Swift message instance. * From d2858a8fe5569befbb53460730c0b7bcf2beed36 Mon Sep 17 00:00:00 2001 From: Anderson Danilo Date: Sat, 28 Oct 2017 19:00:27 -0200 Subject: [PATCH 35/66] Postgres add comment (#18782) --- src/Illuminate/Database/Schema/Blueprint.php | 24 +++++++++++++++++-- .../Database/Schema/Grammars/Grammar.php | 15 ++++++++++++ .../Schema/Grammars/PostgresGrammar.php | 24 +++++++++++++++++++ .../DatabasePostgresSchemaGrammarTest.php | 13 ++++++++++ 4 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 1a8f60c4145b..6788eabffb8f 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -96,7 +96,7 @@ public function build(Connection $connection, Grammar $grammar) */ public function toSql(Connection $connection, Grammar $grammar) { - $this->addImpliedCommands(); + $this->addImpliedCommands($grammar); $statements = []; @@ -121,7 +121,7 @@ public function toSql(Connection $connection, Grammar $grammar) * * @return void */ - protected function addImpliedCommands() + protected function addImpliedCommands(Grammar $grammar) { if (count($this->getAddedColumns()) > 0 && ! $this->creating()) { array_unshift($this->commands, $this->createCommand('add')); @@ -132,6 +132,8 @@ protected function addImpliedCommands() } $this->addFluentIndexes(); + + $this->addFluentCommands($grammar); } /** @@ -164,6 +166,24 @@ protected function addFluentIndexes() } } + public function addFluentCommands(Grammar $grammar) + { + foreach ($this->columns as $column) { + foreach ($grammar->getFluentCommands() as $commandName) { + $attributeName = lcfirst($commandName); + + if (!isset($column->{$attributeName})) + continue; + + $value = $column->{$attributeName}; + + $this->addCommand( + $commandName, compact('value', 'column') + ); + } + } + } + /** * Determine if the blueprint has a create command. * diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index ddd38385710d..2fea9662b293 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -19,6 +19,13 @@ abstract class Grammar extends BaseGrammar */ protected $transactions = false; + /** + * Enable other commands to be executed outside of create or alter command (like indexes) + * + * @var array + */ + protected $fluentCommands = []; + /** * Compile a rename column command. * @@ -120,6 +127,14 @@ protected function getType(Fluent $column) return $this->{'type'.ucfirst($column->type)}($column); } + /** + * @return array + */ + public function getFluentCommands() + { + return $this->fluentCommands; + } + /** * Add the column modifiers to the definition. * diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index 795d4b8f625e..4420c4863116 100755 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -22,6 +22,13 @@ class PostgresGrammar extends Grammar */ protected $modifiers = ['Increment', 'Nullable', 'Default']; + /** + * Enable other commands to be executed outside of create or alter command (like indexes) + * + * @var array + */ + protected $fluentCommands = ['Comment']; + /** * The columns available as serials. * @@ -297,6 +304,23 @@ public function compileDisableForeignKeyConstraints() return 'SET CONSTRAINTS ALL DEFERRED;'; } + /** + * Compile a plain index key command. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $command + * @return string + */ + public function compileComment(Blueprint $blueprint, Fluent $command) + { + return sprintf('comment on column %s.%s is %s', + $this->wrapTable($blueprint), + $this->wrap($command->column->name), + "'".addslashes($command->value)."'" + ); + } + + /** * Create the column definition for a char type. * diff --git a/tests/Database/DatabasePostgresSchemaGrammarTest.php b/tests/Database/DatabasePostgresSchemaGrammarTest.php index 13ab3b782a30..e3dbd19c7203 100755 --- a/tests/Database/DatabasePostgresSchemaGrammarTest.php +++ b/tests/Database/DatabasePostgresSchemaGrammarTest.php @@ -33,6 +33,19 @@ public function testBasicCreateTable() $this->assertEquals('alter table "users" add column "id" serial primary key not null, add column "email" varchar(255) not null', $statements[0]); } + public function testCreateTableAndCommentColumn() + { + $blueprint = new Blueprint('users'); + $blueprint->create(); + $blueprint->increments('id'); + $blueprint->string('email')->comment("my first comment"); + $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); + + $this->assertCount(2, $statements); + $this->assertEquals('create table "users" ("id" serial primary key not null, "email" varchar(255) not null)', $statements[0]); + $this->assertEquals('comment on column "users"."email" is \'my first comment\'', $statements[1]); + } + public function testDropTable() { $blueprint = new Blueprint('users'); From 35d37f09081f9c5da807cf755cf07405f59168b6 Mon Sep 17 00:00:00 2001 From: Anderson Danilo Date: Sat, 28 Oct 2017 19:06:45 -0200 Subject: [PATCH 36/66] fix style --- src/Illuminate/Database/Schema/Blueprint.php | 3 ++- src/Illuminate/Database/Schema/Grammars/Grammar.php | 2 +- src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php | 3 +-- tests/Database/DatabasePostgresSchemaGrammarTest.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 6788eabffb8f..890eab9835d3 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -172,8 +172,9 @@ public function addFluentCommands(Grammar $grammar) foreach ($grammar->getFluentCommands() as $commandName) { $attributeName = lcfirst($commandName); - if (!isset($column->{$attributeName})) + if (! isset($column->{$attributeName})) { continue; + } $value = $column->{$attributeName}; diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index 2fea9662b293..5c7ec0f4ee6d 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -20,7 +20,7 @@ abstract class Grammar extends BaseGrammar protected $transactions = false; /** - * Enable other commands to be executed outside of create or alter command (like indexes) + * Enable other commands to be executed outside of create or alter command (like indexes). * * @var array */ diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index 4420c4863116..4b20ffc0d32d 100755 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -23,7 +23,7 @@ class PostgresGrammar extends Grammar protected $modifiers = ['Increment', 'Nullable', 'Default']; /** - * Enable other commands to be executed outside of create or alter command (like indexes) + * Enable other commands to be executed outside of create or alter command (like indexes). * * @var array */ @@ -320,7 +320,6 @@ public function compileComment(Blueprint $blueprint, Fluent $command) ); } - /** * Create the column definition for a char type. * diff --git a/tests/Database/DatabasePostgresSchemaGrammarTest.php b/tests/Database/DatabasePostgresSchemaGrammarTest.php index e3dbd19c7203..addc649ef374 100755 --- a/tests/Database/DatabasePostgresSchemaGrammarTest.php +++ b/tests/Database/DatabasePostgresSchemaGrammarTest.php @@ -38,7 +38,7 @@ public function testCreateTableAndCommentColumn() $blueprint = new Blueprint('users'); $blueprint->create(); $blueprint->increments('id'); - $blueprint->string('email')->comment("my first comment"); + $blueprint->string('email')->comment('my first comment'); $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertCount(2, $statements); From ca3146d72fab9f06a24e197f556654780c93dead Mon Sep 17 00:00:00 2001 From: Antonio Carlos Ribeiro Date: Sun, 29 Oct 2017 11:50:41 -0200 Subject: [PATCH 37/66] Fix uniqueStrict for keyless collections (#21854) --- src/Illuminate/Support/Collection.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index 13898792cbbd..22a0f3cdadb9 100644 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -1482,10 +1482,6 @@ public function transform(callable $callback) */ public function unique($key = null, $strict = false) { - if (is_null($key)) { - return new static(array_unique($this->items, SORT_REGULAR)); - } - $callback = $this->valueRetriever($key); $exists = []; From 07da71fd3476520df1b626aedb613124e91ed752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Mon, 30 Oct 2017 23:26:30 +0100 Subject: [PATCH 38/66] Added argon hashing support. --- src/Illuminate/Hashing/ArgonHasher.php | 161 ++++++++++++++++++ src/Illuminate/Hashing/HashManager.php | 38 +++++ .../Hashing/HashServiceProvider.php | 4 +- tests/Hashing/BcryptHasherTest.php | 18 -- tests/Hashing/HasherTest.php | 32 ++++ 5 files changed, 233 insertions(+), 20 deletions(-) create mode 100644 src/Illuminate/Hashing/ArgonHasher.php create mode 100644 src/Illuminate/Hashing/HashManager.php delete mode 100755 tests/Hashing/BcryptHasherTest.php create mode 100755 tests/Hashing/HasherTest.php diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php new file mode 100644 index 000000000000..16c5ef4240ba --- /dev/null +++ b/src/Illuminate/Hashing/ArgonHasher.php @@ -0,0 +1,161 @@ + $this->memory($options), + 'time_cost' => $this->time($options), + 'threads' => $this->processors($options) + ]); + + if ($hash === false) { + throw new RuntimeException('Bcrypt hashing not supported.'); + } + + return $hash; + } + + /** + * Check the given plain value against a hash. + * + * @param string $value + * @param string $hashedValue + * @param array $options + * @return bool + */ + public function check($value, $hashedValue, array $options = []) + { + if (strlen($hashedValue) === 0) { + return false; + } + + return password_verify($value, $hashedValue); + } + + /** + * Check if the given hash has been hashed using the given options. + * + * @param string $hashedValue + * @param array $options + * @return bool + */ + public function needsRehash($hashedValue, array $options = []) + { + return password_needs_rehash($hashedValue, PASSWORD_ARGON2I, [ + 'memory_cost' => $this->memory($options), + 'time_cost' => $this->time($options), + 'threads' => $this->processors($options) + ]); + } + + /** + * Set the default password threads factor. + * + * @param int $threads + * + * @return $this; + */ + public function setProcessors(int $threads) + { + $this->threads = $threads; + + return $this; + } + + /** + * Set the default password memory factor. + * + * @param int $memory + * + * @return $this + */ + public function setMemory($memory) + { + $this->memory = $memory; + + return $this; + } + + /** + * Set the default password timing factor. + * + * @param int $time + * + * @return $this + */ + public function setTime(int $time) + { + $this->time = $time; + + return $this; + } + + /** + * Extract the memory cost value from the options array. + * + * @param $options + * @return int + */ + protected function memory($options) + { + return $options['memory'] ?? $this->memory; + } + + /** + * Extract the time cost value from the options array. + * + * @param $options + * @return int + */ + protected function time($options) + { + return $options['time'] ?? $this->time; + } + + /** + * Extract the threads value from the options array. + * + * @param $options + * @return int + */ + protected function processors($options) + { + return $options['processors'] ?? $this->processors; + } +} \ No newline at end of file diff --git a/src/Illuminate/Hashing/HashManager.php b/src/Illuminate/Hashing/HashManager.php new file mode 100644 index 000000000000..f0b56c6e8d80 --- /dev/null +++ b/src/Illuminate/Hashing/HashManager.php @@ -0,0 +1,38 @@ +app['config']['hashing.driver']; + } + + /** + * Create an instance of the Brycrypt hash Driver. + * + * @return BcryptHasher + */ + public function createBcryptDriver() + { + return new BcryptHasher; + } + + /** + * Create an instance of the Argon2 hash Driver. + * + * @return ArgonHasher + */ + public function createArgonDriver() + { + return new ArgonHasher; + } +} \ No newline at end of file diff --git a/src/Illuminate/Hashing/HashServiceProvider.php b/src/Illuminate/Hashing/HashServiceProvider.php index 85581f40cf65..b4baabcb7f11 100755 --- a/src/Illuminate/Hashing/HashServiceProvider.php +++ b/src/Illuminate/Hashing/HashServiceProvider.php @@ -20,8 +20,8 @@ class HashServiceProvider extends ServiceProvider */ public function register() { - $this->app->singleton('hash', function () { - return new BcryptHasher; + $this->app->singleton('hash', function ($app) { + return (new HashManager($app))->driver(); }); } diff --git a/tests/Hashing/BcryptHasherTest.php b/tests/Hashing/BcryptHasherTest.php deleted file mode 100755 index e223b71dc4a7..000000000000 --- a/tests/Hashing/BcryptHasherTest.php +++ /dev/null @@ -1,18 +0,0 @@ -make('password'); - $this->assertNotSame('password', $value); - $this->assertTrue($hasher->check('password', $value)); - $this->assertFalse($hasher->needsRehash($value)); - $this->assertTrue($hasher->needsRehash($value, ['rounds' => 1])); - } -} diff --git a/tests/Hashing/HasherTest.php b/tests/Hashing/HasherTest.php new file mode 100755 index 000000000000..1ac9d34089d6 --- /dev/null +++ b/tests/Hashing/HasherTest.php @@ -0,0 +1,32 @@ +make('password'); + $this->assertNotSame('password', $value); + $this->assertTrue($hasher->check('password', $value)); + $this->assertFalse($hasher->needsRehash($value)); + $this->assertTrue($hasher->needsRehash($value, ['rounds' => 1])); + } + + public function testBasicArgonHashing() + { + if (! defined('PASSWORD_ARGON2I')) { + $this->markTestSkipped('PHP not compiled with argon2 hashing support support.'); + } + + $hasher = new \Illuminate\Hashing\ArgonHasher; + $value = $hasher->make('password'); + $this->assertNotSame('password', $value); + $this->assertTrue($hasher->check('password', $value)); + $this->assertFalse($hasher->needsRehash($value)); + $this->assertTrue($hasher->needsRehash($value, ['processors' => 1])); + } +} From c946aa3098bc9435067ce8d2dc1bad5bb5ccc450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Tue, 31 Oct 2017 00:08:28 +0100 Subject: [PATCH 39/66] Fix integration tests. It was due to the new configuration not beeing loaded when integration testing took place. --- src/Illuminate/Foundation/Application.php | 2 +- tests/Integration/Auth/AuthenticationTest.php | 2 ++ tests/Integration/Http/ThrottleRequestsTest.php | 5 +++++ tests/Integration/Http/ThrottleRequestsWithRedisTest.php | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 558df255e230..14fc68965f03 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -1111,7 +1111,7 @@ public function registerCoreContainerAliases() 'filesystem' => [\Illuminate\Filesystem\FilesystemManager::class, \Illuminate\Contracts\Filesystem\Factory::class], 'filesystem.disk' => [\Illuminate\Contracts\Filesystem\Filesystem::class], 'filesystem.cloud' => [\Illuminate\Contracts\Filesystem\Cloud::class], - 'hash' => [\Illuminate\Contracts\Hashing\Hasher::class], + 'hash' => [\Illuminate\Hashing\HashManager::class], 'translator' => [\Illuminate\Translation\Translator::class, \Illuminate\Contracts\Translation\Translator::class], 'log' => [\Illuminate\Log\Writer::class, \Illuminate\Contracts\Logging\Log::class, \Psr\Log\LoggerInterface::class], 'mailer' => [\Illuminate\Mail\Mailer::class, \Illuminate\Contracts\Mail\Mailer::class, \Illuminate\Contracts\Mail\MailQueue::class], diff --git a/tests/Integration/Auth/AuthenticationTest.php b/tests/Integration/Auth/AuthenticationTest.php index 7faea9f38a84..475a8c5bb84e 100644 --- a/tests/Integration/Auth/AuthenticationTest.php +++ b/tests/Integration/Auth/AuthenticationTest.php @@ -24,6 +24,8 @@ protected function getEnvironmentSetUp($app) 'database' => ':memory:', 'prefix' => '', ]); + + $app['config']->set('hashing', ['driver' => 'bcrypt']); } public function setUp() diff --git a/tests/Integration/Http/ThrottleRequestsTest.php b/tests/Integration/Http/ThrottleRequestsTest.php index 824427842e34..45c5b7e9c420 100644 --- a/tests/Integration/Http/ThrottleRequestsTest.php +++ b/tests/Integration/Http/ThrottleRequestsTest.php @@ -19,6 +19,11 @@ public function tearDown() Carbon::setTestNow(null); } + public function getEnvironmentSetUp($app) + { + $app['config']->set('hashing', ['driver' => 'bcrypt']); + } + public function test_lock_opens_immediately_after_decay() { Carbon::setTestNow(null); diff --git a/tests/Integration/Http/ThrottleRequestsWithRedisTest.php b/tests/Integration/Http/ThrottleRequestsWithRedisTest.php index e4e11277110d..123e0f06a010 100644 --- a/tests/Integration/Http/ThrottleRequestsWithRedisTest.php +++ b/tests/Integration/Http/ThrottleRequestsWithRedisTest.php @@ -22,6 +22,11 @@ public function tearDown() Carbon::setTestNow(null); } + public function getEnvironmentSetUp($app) + { + $app['config']->set('hashing', ['driver' => 'bcrypt']); + } + public function test_lock_opens_immediately_after_decay() { $this->ifRedisAvailable(function () { From e4c0c56e3e43d5e533699dab70ca69f7f0f29754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Tue, 31 Oct 2017 00:39:00 +0100 Subject: [PATCH 40/66] It's argon not bcrypt. --- src/Illuminate/Hashing/ArgonHasher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php index 16c5ef4240ba..1d9b477f4d7c 100644 --- a/src/Illuminate/Hashing/ArgonHasher.php +++ b/src/Illuminate/Hashing/ArgonHasher.php @@ -45,7 +45,7 @@ public function make($value, array $options = []) ]); if ($hash === false) { - throw new RuntimeException('Bcrypt hashing not supported.'); + throw new RuntimeException('Argon2 hashing not supported.'); } return $hash; From e2d178ce435c9dbfafdada423b0b839fcda5c82f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 31 Oct 2017 08:15:45 -0500 Subject: [PATCH 41/66] fix various formatting problems --- src/Illuminate/Database/Schema/Blueprint.php | 7 +++++++ .../Database/Schema/Grammars/Grammar.php | 20 ++++++++++--------- .../Schema/Grammars/PostgresGrammar.php | 10 +++++----- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 61472a078f70..7a3453e8629b 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -119,6 +119,7 @@ public function toSql(Connection $connection, Grammar $grammar) /** * Add the commands that are implied by the blueprint's state. * + * @param \Illuminate\Database\Grammar $grammer * @return void */ protected function addImpliedCommands(Grammar $grammar) @@ -166,6 +167,12 @@ protected function addFluentIndexes() } } + /** + * Add the fluent commands specified on any columns. + * + * @param \Illuminate\Database\Grammar $grammer + * @param + */ public function addFluentCommands(Grammar $grammar) { foreach ($this->columns as $column) { diff --git a/src/Illuminate/Database/Schema/Grammars/Grammar.php b/src/Illuminate/Database/Schema/Grammars/Grammar.php index 5c7ec0f4ee6d..1ea4dabc8977 100755 --- a/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -20,7 +20,7 @@ abstract class Grammar extends BaseGrammar protected $transactions = false; /** - * Enable other commands to be executed outside of create or alter command (like indexes). + * The commands to be executed outside of create or alter command. * * @var array */ @@ -127,14 +127,6 @@ protected function getType(Fluent $column) return $this->{'type'.ucfirst($column->type)}($column); } - /** - * @return array - */ - public function getFluentCommands() - { - return $this->fluentCommands; - } - /** * Add the column modifiers to the definition. * @@ -258,6 +250,16 @@ public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema }); } + /** + * Get the fluent commands for the grammar. + * + * @return array + */ + public function getFluentCommands() + { + return $this->fluentCommands; + } + /** * Check if this Grammar supports schema changes wrapped in a transaction. * diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index 4b20ffc0d32d..d7a3fcd0d363 100755 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -23,18 +23,18 @@ class PostgresGrammar extends Grammar protected $modifiers = ['Increment', 'Nullable', 'Default']; /** - * Enable other commands to be executed outside of create or alter command (like indexes). + * The columns available as serials. * * @var array */ - protected $fluentCommands = ['Comment']; + protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger']; /** - * The columns available as serials. + * The commands to be executed outside of create or alter command. * * @var array */ - protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger']; + protected $fluentCommands = ['Comment']; /** * Compile the query to determine if a table exists. @@ -305,7 +305,7 @@ public function compileDisableForeignKeyConstraints() } /** - * Compile a plain index key command. + * Compile a comment command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command From 23c1bcfcc11aeec482438e08749b88f05e2691ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Tue, 31 Oct 2017 18:13:39 +0100 Subject: [PATCH 42/66] Added Argon helper method. And also forced both functions to be of their driver type. Also some cleanup --- src/Illuminate/Foundation/helpers.php | 22 ++++++++++++++++++++-- src/Illuminate/Hashing/ArgonHasher.php | 5 ++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index f3cbd85364df..36759e138a7f 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -124,6 +124,22 @@ function app_path($path = '') } } +if (! function_exists('argon')) { + /** + * Hash the given value against the Argon2i algorithm. + * + * @param string $value + * @param array $options + * @return string + */ + function argon($value, $options = []) + { + return app('hash') + ->driver('argon') + ->make($value, $options); + } +} + if (! function_exists('asset')) { /** * Generate an asset path for the application. @@ -185,7 +201,7 @@ function base_path($path = '') if (! function_exists('bcrypt')) { /** - * Hash the given value. + * Hash the given value against the bcrypt algorithm. * * @param string $value * @param array $options @@ -193,7 +209,9 @@ function base_path($path = '') */ function bcrypt($value, $options = []) { - return app('hash')->make($value, $options); + return app('hash') + ->driver('bcrypt') + ->make($value, $options); } } diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php index 1d9b477f4d7c..9e7e1ba9bd15 100644 --- a/src/Illuminate/Hashing/ArgonHasher.php +++ b/src/Illuminate/Hashing/ArgonHasher.php @@ -2,14 +2,13 @@ namespace Illuminate\Hashing; - use RuntimeException; use Illuminate\Contracts\Hashing\Hasher as HasherContract; class ArgonHasher implements HasherContract { /** - * Default threads factor + * Default threads factor. * * @var int */ @@ -105,7 +104,7 @@ public function setProcessors(int $threads) * * @return $this */ - public function setMemory($memory) + public function setMemory(int $memory) { $this->memory = $memory; From 7c51951a213edc83355ccd7f15a3f21a8988bed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Wed, 1 Nov 2017 08:51:09 +0100 Subject: [PATCH 43/66] Remove helper. --- src/Illuminate/Foundation/helpers.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 36759e138a7f..b5e6b3a5bc45 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -124,22 +124,6 @@ function app_path($path = '') } } -if (! function_exists('argon')) { - /** - * Hash the given value against the Argon2i algorithm. - * - * @param string $value - * @param array $options - * @return string - */ - function argon($value, $options = []) - { - return app('hash') - ->driver('argon') - ->make($value, $options); - } -} - if (! function_exists('asset')) { /** * Generate an asset path for the application. From f1584bff48c8993eadcacd459d3db822f6cb387f Mon Sep 17 00:00:00 2001 From: Patrick O'Meara Date: Thu, 2 Nov 2017 00:58:52 +1100 Subject: [PATCH 44/66] syncOriginal on refresh (#21905) --- src/Illuminate/Database/Eloquent/Model.php | 2 ++ .../Database/EloquentModelRefreshTest.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index b47d653d8712..e5246a0413fe 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -1006,6 +1006,8 @@ public function refresh() $this->load(collect($this->relations)->except('pivot')->keys()->toArray()); + $this->syncOriginal(); + return $this; } diff --git a/tests/Integration/Database/EloquentModelRefreshTest.php b/tests/Integration/Database/EloquentModelRefreshTest.php index 9687f5d32805..aa4b9828c7f1 100644 --- a/tests/Integration/Database/EloquentModelRefreshTest.php +++ b/tests/Integration/Database/EloquentModelRefreshTest.php @@ -63,6 +63,22 @@ public function it_refreshes_a_soft_deleted_model() $this->assertTrue($post->trashed()); } + + /** + * @test + */ + public function it_syncs_original_on_refresh() + { + $post = Post::create(['title' => 'pat']); + + Post::find($post->id)->update(['title' => 'patrick']); + + $post->refresh(); + + $this->assertEmpty($post->getDirty()); + + $this->assertEquals('patrick', $post->getOriginal('title')); + } } class Post extends Model From 62b74e5d5012087c50ef7549a51309096cdd0329 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Wed, 1 Nov 2017 09:59:27 -0400 Subject: [PATCH 45/66] Remove unused raise worker method (#21901) --- src/Illuminate/Queue/Worker.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index fc8b01e3601f..fdbaedca7577 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -476,21 +476,6 @@ protected function raiseExceptionOccurredJobEvent($connectionName, $job, $e) )); } - /** - * Raise the failed queue job event. - * - * @param string $connectionName - * @param \Illuminate\Contracts\Queue\Job $job - * @param \Exception $e - * @return void - */ - protected function raiseFailedJobEvent($connectionName, $job, $e) - { - $this->events->dispatch(new Events\JobFailed( - $connectionName, $job, $e - )); - } - /** * Determine if the queue worker should restart. * From b7ddd6c29b9b451502f7e9c2fde4a94190f8d406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Thu, 2 Nov 2017 15:19:51 +0100 Subject: [PATCH 46/66] Fix failing tests. And really forced bcrypt this time! :) --- src/Illuminate/Foundation/helpers.php | 3 +-- src/Illuminate/Hashing/HashServiceProvider.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index b5e6b3a5bc45..94742865fcf1 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -193,8 +193,7 @@ function base_path($path = '') */ function bcrypt($value, $options = []) { - return app('hash') - ->driver('bcrypt') + return app('hash.bcrypt') ->make($value, $options); } } diff --git a/src/Illuminate/Hashing/HashServiceProvider.php b/src/Illuminate/Hashing/HashServiceProvider.php index b4baabcb7f11..0357172b39c2 100755 --- a/src/Illuminate/Hashing/HashServiceProvider.php +++ b/src/Illuminate/Hashing/HashServiceProvider.php @@ -20,8 +20,16 @@ class HashServiceProvider extends ServiceProvider */ public function register() { + $this->app->singleton('hash.manager', function ($app) { + return (new HashManager($app)); + }); + $this->app->singleton('hash', function ($app) { - return (new HashManager($app))->driver(); + return $app['hash.manager']->driver(); + }); + + $this->app->singleton('hash.bcrypt', function($app) { + return $app['hash.manager']->driver('bcrypt'); }); } @@ -32,6 +40,6 @@ public function register() */ public function provides() { - return ['hash']; + return ['hash', 'hash.manager', 'hash.bcrypt']; } } From c272b15a6ed47b222c5fc1901127d12c7a51befa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Sat, 4 Nov 2017 01:36:09 +0100 Subject: [PATCH 47/66] Second try on manager. --- src/Illuminate/Foundation/helpers.php | 3 ++- src/Illuminate/Hashing/HashServiceProvider.php | 12 ++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 94742865fcf1..b5e6b3a5bc45 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -193,7 +193,8 @@ function base_path($path = '') */ function bcrypt($value, $options = []) { - return app('hash.bcrypt') + return app('hash') + ->driver('bcrypt') ->make($value, $options); } } diff --git a/src/Illuminate/Hashing/HashServiceProvider.php b/src/Illuminate/Hashing/HashServiceProvider.php index 0357172b39c2..5b8d525463d9 100755 --- a/src/Illuminate/Hashing/HashServiceProvider.php +++ b/src/Illuminate/Hashing/HashServiceProvider.php @@ -20,16 +20,8 @@ class HashServiceProvider extends ServiceProvider */ public function register() { - $this->app->singleton('hash.manager', function ($app) { - return (new HashManager($app)); - }); - $this->app->singleton('hash', function ($app) { - return $app['hash.manager']->driver(); - }); - - $this->app->singleton('hash.bcrypt', function($app) { - return $app['hash.manager']->driver('bcrypt'); + return new HashManager($app); }); } @@ -40,6 +32,6 @@ public function register() */ public function provides() { - return ['hash', 'hash.manager', 'hash.bcrypt']; + return ['hash']; } } From b26021248cbc762ebd7069e12dde1f0ebde42a74 Mon Sep 17 00:00:00 2001 From: Dallin Date: Sun, 5 Nov 2017 08:29:26 -0700 Subject: [PATCH 48/66] Adds bulk binding ability to service providers during registration --- src/Illuminate/Foundation/Application.php | 12 +++++ .../Foundation/FoundationApplicationTest.php | 54 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 2f46dc08555d..0279df4276b1 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -586,6 +586,18 @@ public function register($provider, $options = [], $force = false) $provider->register(); } + if (property_exists($provider, 'bind')) { + foreach ($provider->bind as $abstract => $concrete) { + $this->bind($abstract, $concrete); + } + } + + if (property_exists($provider, 'singletons')) { + foreach ($provider->singletons as $abstract => $concrete) { + $this->singleton($abstract, $concrete); + } + } + $this->markAsRegistered($provider); // If the application has already booted, we will call this boot method on diff --git a/tests/Foundation/FoundationApplicationTest.php b/tests/Foundation/FoundationApplicationTest.php index b29924fba0ff..a181cb163e83 100755 --- a/tests/Foundation/FoundationApplicationTest.php +++ b/tests/Foundation/FoundationApplicationTest.php @@ -5,6 +5,7 @@ use Mockery as m; use PHPUnit\Framework\TestCase; use Illuminate\Foundation\Application; +use Illuminate\Support\ServiceProvider; class FoundationApplicationTest extends TestCase { @@ -37,6 +38,30 @@ public function testServiceProvidersAreCorrectlyRegistered() $this->assertTrue(in_array($class, $app->getLoadedProviders())); } + public function testClassesAreBoundWhenServiceProviderIsRegistered() + { + $app = new Application; + $provider = new ServiceProviderForTestingThree($app); + $app->register($provider); + + $this->assertTrue(in_array(get_class($provider), $app->getLoadedProviders())); + + $this->assertInstanceOf(ConcreteClass::class, $app->make(AbstractClass::class)); + } + + public function testSingletonsAreCreatedWhenServiceProviderIsRegistered() + { + $app = new Application; + $provider = new ServiceProviderForTestingThree($app); + $app->register($provider); + + $this->assertTrue(in_array(get_class($provider), $app->getLoadedProviders())); + + $instance = $app->make(AbstractClass::class); + + $this->assertSame($instance, $app->make(AbstractClass::class)); + } + public function testServiceProvidersAreCorrectlyRegisteredWhenRegisterMethodIsNotPresent() { $provider = m::mock('Illuminate\Support\ServiceProvider'); @@ -259,3 +284,32 @@ public function register() }); } } + +class ServiceProviderForTestingThree extends ServiceProvider +{ + public $bind = [ + AbstractClass::class => ConcreteClass::class, + ]; + + public $singletons = [ + AbstractClass::class => ConcreteClass::class, + ]; + + public function register() + { + } + + public function boot() + { + } +} + +abstract class AbstractClass +{ + // +} + +class ConcreteClass extends AbstractClass +{ + // +} From a351cb80905a0377fc61a65a3258b0704ce82288 Mon Sep 17 00:00:00 2001 From: Vinter Skogen Date: Mon, 6 Nov 2017 16:41:41 +0300 Subject: [PATCH 49/66] Comments in docblocks no more referencing the whole application (#21971) --- src/Illuminate/Foundation/Console/stubs/provider.stub | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Console/stubs/provider.stub b/src/Illuminate/Foundation/Console/stubs/provider.stub index 4303cf7b512b..23b237c9248b 100644 --- a/src/Illuminate/Foundation/Console/stubs/provider.stub +++ b/src/Illuminate/Foundation/Console/stubs/provider.stub @@ -7,7 +7,7 @@ use Illuminate\Support\ServiceProvider; class DummyClass extends ServiceProvider { /** - * Bootstrap the application services. + * Bootstrap services. * * @return void */ @@ -17,7 +17,7 @@ class DummyClass extends ServiceProvider } /** - * Register the application services. + * Register services. * * @return void */ From 68ac51a3c85d039799d32f53a045328e14debfea Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 6 Nov 2017 07:59:37 -0600 Subject: [PATCH 50/66] implement contract on manager --- src/Illuminate/Foundation/helpers.php | 6 +-- src/Illuminate/Hashing/HashManager.php | 62 +++++++++++++++++++++----- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index b5e6b3a5bc45..864584a69450 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -188,14 +188,12 @@ function base_path($path = '') * Hash the given value against the bcrypt algorithm. * * @param string $value - * @param array $options + * @param array $options * @return string */ function bcrypt($value, $options = []) { - return app('hash') - ->driver('bcrypt') - ->make($value, $options); + return app('hash')->driver('bcrypt')->make($value, $options); } } diff --git a/src/Illuminate/Hashing/HashManager.php b/src/Illuminate/Hashing/HashManager.php index f0b56c6e8d80..3f51c184e730 100644 --- a/src/Illuminate/Hashing/HashManager.php +++ b/src/Illuminate/Hashing/HashManager.php @@ -3,19 +3,10 @@ namespace Illuminate\Hashing; use Illuminate\Support\Manager; +use Illuminate\Contracts\Hashing\Hasher; -class HashManager extends Manager +class HashManager extends Manager implements Hasher { - /** - * Get the default driver name. - * - * @return string - */ - public function getDefaultDriver() - { - return $this->app['config']['hashing.driver']; - } - /** * Create an instance of the Brycrypt hash Driver. * @@ -35,4 +26,51 @@ public function createArgonDriver() { return new ArgonHasher; } -} \ No newline at end of file + + /** + * Hash the given value. + * + * @param string $value + * @param array $options + * @return string + */ + public function make($value, array $options = []) + { + return $this->driver()->make($value, $options); + } + + /** + * Check the given plain value against a hash. + * + * @param string $value + * @param string $hashedValue + * @param array $options + * @return bool + */ + public function check($value, $hashedValue, array $options = []) + { + return $this->driver()->check($value, $hashedValue, $options); + } + + /** + * Check if the given hash has been hashed using the given options. + * + * @param string $hashedValue + * @param array $options + * @return bool + */ + public function needsRehash($hashedValue, array $options = []) + { + return $this->driver()->needsRehash($hashedValue, $options); + } + + /** + * Get the default driver name. + * + * @return string + */ + public function getDefaultDriver() + { + return $this->app['config']['hashing.driver']; + } +} From 72da6a524a4514914031c367f112facbbeb0f73a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 6 Nov 2017 08:02:25 -0600 Subject: [PATCH 51/66] Apply fixes from StyleCI (#21972) --- src/Illuminate/Hashing/ArgonHasher.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Hashing/ArgonHasher.php b/src/Illuminate/Hashing/ArgonHasher.php index 9e7e1ba9bd15..f6a4718c8f6a 100644 --- a/src/Illuminate/Hashing/ArgonHasher.php +++ b/src/Illuminate/Hashing/ArgonHasher.php @@ -40,7 +40,7 @@ public function make($value, array $options = []) $hash = password_hash($value, PASSWORD_ARGON2I, [ 'memory_cost' => $this->memory($options), 'time_cost' => $this->time($options), - 'threads' => $this->processors($options) + 'threads' => $this->processors($options), ]); if ($hash === false) { @@ -79,7 +79,7 @@ public function needsRehash($hashedValue, array $options = []) return password_needs_rehash($hashedValue, PASSWORD_ARGON2I, [ 'memory_cost' => $this->memory($options), 'time_cost' => $this->time($options), - 'threads' => $this->processors($options) + 'threads' => $this->processors($options), ]); } @@ -157,4 +157,4 @@ protected function processors($options) { return $options['processors'] ?? $this->processors; } -} \ No newline at end of file +} From af7d7cd6f74e686de337b901bd3936857b7e8773 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 7 Nov 2017 20:23:51 +0000 Subject: [PATCH 52/66] Bumped min php version in preperation for symfony 4 upgrade (#21995) --- .travis.yml | 3 --- composer.json | 2 +- src/Illuminate/Auth/composer.json | 2 +- src/Illuminate/Broadcasting/composer.json | 2 +- src/Illuminate/Bus/composer.json | 2 +- src/Illuminate/Cache/composer.json | 2 +- src/Illuminate/Config/composer.json | 2 +- src/Illuminate/Console/composer.json | 2 +- src/Illuminate/Container/composer.json | 2 +- src/Illuminate/Contracts/composer.json | 2 +- src/Illuminate/Cookie/composer.json | 2 +- src/Illuminate/Database/composer.json | 2 +- src/Illuminate/Encryption/composer.json | 2 +- src/Illuminate/Events/composer.json | 2 +- src/Illuminate/Filesystem/composer.json | 2 +- src/Illuminate/Hashing/composer.json | 2 +- src/Illuminate/Http/composer.json | 2 +- src/Illuminate/Log/composer.json | 2 +- src/Illuminate/Mail/composer.json | 2 +- src/Illuminate/Notifications/composer.json | 2 +- src/Illuminate/Pagination/composer.json | 2 +- src/Illuminate/Pipeline/composer.json | 2 +- src/Illuminate/Queue/composer.json | 2 +- src/Illuminate/Redis/composer.json | 2 +- src/Illuminate/Routing/composer.json | 2 +- src/Illuminate/Session/composer.json | 2 +- src/Illuminate/Support/composer.json | 2 +- src/Illuminate/Translation/composer.json | 2 +- src/Illuminate/Validation/composer.json | 2 +- src/Illuminate/View/composer.json | 2 +- 30 files changed, 29 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d48e602f13e..742efffd57de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,6 @@ env: matrix: fast_finish: true include: - - php: 7.0.21 - - php: 7.0.21 - env: setup=lowest - php: 7.1 - php: 7.1 env: setup=lowest diff --git a/composer.json b/composer.json index 1f9ca4da2110..fa67b680bf5c 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "ext-mbstring": "*", "ext-openssl": "*", "doctrine/inflector": "~1.1", diff --git a/src/Illuminate/Auth/composer.json b/src/Illuminate/Auth/composer.json index 8d7421514691..896c871a3919 100644 --- a/src/Illuminate/Auth/composer.json +++ b/src/Illuminate/Auth/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/http": "5.6.*", "illuminate/queue": "5.6.*", diff --git a/src/Illuminate/Broadcasting/composer.json b/src/Illuminate/Broadcasting/composer.json index bd34d160ead4..acde1aceb335 100644 --- a/src/Illuminate/Broadcasting/composer.json +++ b/src/Illuminate/Broadcasting/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/bus": "5.6.*", "illuminate/contracts": "5.6.*", "illuminate/queue": "5.6.*", diff --git a/src/Illuminate/Bus/composer.json b/src/Illuminate/Bus/composer.json index a95e4815265e..4939a99d921b 100644 --- a/src/Illuminate/Bus/composer.json +++ b/src/Illuminate/Bus/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/pipeline": "5.6.*", "illuminate/support": "5.6.*" diff --git a/src/Illuminate/Cache/composer.json b/src/Illuminate/Cache/composer.json index 69ff3d20b962..48b7e1bb7a73 100755 --- a/src/Illuminate/Cache/composer.json +++ b/src/Illuminate/Cache/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" }, diff --git a/src/Illuminate/Config/composer.json b/src/Illuminate/Config/composer.json index 3cd7bb53a9f9..f79f6f5665bb 100755 --- a/src/Illuminate/Config/composer.json +++ b/src/Illuminate/Config/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" }, diff --git a/src/Illuminate/Console/composer.json b/src/Illuminate/Console/composer.json index 87158ef7b3b3..2fcdc11cf506 100755 --- a/src/Illuminate/Console/composer.json +++ b/src/Illuminate/Console/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*", "symfony/console": "~3.3" diff --git a/src/Illuminate/Container/composer.json b/src/Illuminate/Container/composer.json index 46f3d1e82641..b8c4aafc738a 100755 --- a/src/Illuminate/Container/composer.json +++ b/src/Illuminate/Container/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "psr/container": "~1.0" }, diff --git a/src/Illuminate/Contracts/composer.json b/src/Illuminate/Contracts/composer.json index 9d7ff975b2bd..bd00fd61626e 100644 --- a/src/Illuminate/Contracts/composer.json +++ b/src/Illuminate/Contracts/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "psr/container": "~1.0", "psr/simple-cache": "~1.0" }, diff --git a/src/Illuminate/Cookie/composer.json b/src/Illuminate/Cookie/composer.json index 774a4c7abfd9..11e27be2e2f3 100755 --- a/src/Illuminate/Cookie/composer.json +++ b/src/Illuminate/Cookie/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*", "symfony/http-foundation": "~3.3", diff --git a/src/Illuminate/Database/composer.json b/src/Illuminate/Database/composer.json index 5e69ea7f56ff..769327fa17fd 100644 --- a/src/Illuminate/Database/composer.json +++ b/src/Illuminate/Database/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" diff --git a/src/Illuminate/Encryption/composer.json b/src/Illuminate/Encryption/composer.json index 40eb5945040c..73486ababaf9 100644 --- a/src/Illuminate/Encryption/composer.json +++ b/src/Illuminate/Encryption/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "ext-mbstring": "*", "ext-openssl": "*", "illuminate/contracts": "5.6.*", diff --git a/src/Illuminate/Events/composer.json b/src/Illuminate/Events/composer.json index 87fa92658589..ceca48505b3f 100755 --- a/src/Illuminate/Events/composer.json +++ b/src/Illuminate/Events/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" diff --git a/src/Illuminate/Filesystem/composer.json b/src/Illuminate/Filesystem/composer.json index 26184bc6304f..1a9cfe3f2eb9 100644 --- a/src/Illuminate/Filesystem/composer.json +++ b/src/Illuminate/Filesystem/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*", "symfony/finder": "~3.3" diff --git a/src/Illuminate/Hashing/composer.json b/src/Illuminate/Hashing/composer.json index 369fe66b8979..f7dae2f4408a 100755 --- a/src/Illuminate/Hashing/composer.json +++ b/src/Illuminate/Hashing/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" }, diff --git a/src/Illuminate/Http/composer.json b/src/Illuminate/Http/composer.json index 41666813520e..2e9e91f130ae 100755 --- a/src/Illuminate/Http/composer.json +++ b/src/Illuminate/Http/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/session": "5.6.*", "illuminate/support": "5.6.*", "symfony/http-foundation": "~3.3", diff --git a/src/Illuminate/Log/composer.json b/src/Illuminate/Log/composer.json index 192b40e88641..15f56f0182a3 100755 --- a/src/Illuminate/Log/composer.json +++ b/src/Illuminate/Log/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*", "monolog/monolog": "~1.11" diff --git a/src/Illuminate/Mail/composer.json b/src/Illuminate/Mail/composer.json index fe06844e7fa2..c84186a563ca 100755 --- a/src/Illuminate/Mail/composer.json +++ b/src/Illuminate/Mail/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "erusev/parsedown": "~1.6", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", diff --git a/src/Illuminate/Notifications/composer.json b/src/Illuminate/Notifications/composer.json index 09eb1fb7e55c..c1715cb2027e 100644 --- a/src/Illuminate/Notifications/composer.json +++ b/src/Illuminate/Notifications/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/broadcasting": "5.6.*", "illuminate/bus": "5.6.*", "illuminate/container": "5.6.*", diff --git a/src/Illuminate/Pagination/composer.json b/src/Illuminate/Pagination/composer.json index 3125ddc459db..433829cb730f 100755 --- a/src/Illuminate/Pagination/composer.json +++ b/src/Illuminate/Pagination/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" }, diff --git a/src/Illuminate/Pipeline/composer.json b/src/Illuminate/Pipeline/composer.json index b9bc9df56909..7e08e581ae2d 100644 --- a/src/Illuminate/Pipeline/composer.json +++ b/src/Illuminate/Pipeline/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*" }, diff --git a/src/Illuminate/Queue/composer.json b/src/Illuminate/Queue/composer.json index 5264307c6697..d02dcbb369c3 100644 --- a/src/Illuminate/Queue/composer.json +++ b/src/Illuminate/Queue/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/console": "5.6.*", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", diff --git a/src/Illuminate/Redis/composer.json b/src/Illuminate/Redis/composer.json index b3cc598d9f77..ee8bae7d5d23 100755 --- a/src/Illuminate/Redis/composer.json +++ b/src/Illuminate/Redis/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*", "predis/predis": "~1.0" diff --git a/src/Illuminate/Routing/composer.json b/src/Illuminate/Routing/composer.json index 52ad7840a517..6f97d34a2ca4 100644 --- a/src/Illuminate/Routing/composer.json +++ b/src/Illuminate/Routing/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", "illuminate/http": "5.6.*", diff --git a/src/Illuminate/Session/composer.json b/src/Illuminate/Session/composer.json index e29fe0c1b24a..47aadbe567fb 100755 --- a/src/Illuminate/Session/composer.json +++ b/src/Illuminate/Session/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/filesystem": "5.6.*", "illuminate/support": "5.6.*", diff --git a/src/Illuminate/Support/composer.json b/src/Illuminate/Support/composer.json index f735b17ed825..36a4821b3b75 100644 --- a/src/Illuminate/Support/composer.json +++ b/src/Illuminate/Support/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "ext-mbstring": "*", "doctrine/inflector": "~1.1", "illuminate/contracts": "5.6.*", diff --git a/src/Illuminate/Translation/composer.json b/src/Illuminate/Translation/composer.json index 22ec882f3542..4b01b280a826 100755 --- a/src/Illuminate/Translation/composer.json +++ b/src/Illuminate/Translation/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/contracts": "5.6.*", "illuminate/filesystem": "5.6.*", "illuminate/support": "5.6.*" diff --git a/src/Illuminate/Validation/composer.json b/src/Illuminate/Validation/composer.json index c5deb35f4137..d51ddffc84e0 100755 --- a/src/Illuminate/Validation/composer.json +++ b/src/Illuminate/Validation/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", "illuminate/support": "5.6.*", diff --git a/src/Illuminate/View/composer.json b/src/Illuminate/View/composer.json index 8ffa7b8506bb..fe4c57e0719b 100644 --- a/src/Illuminate/View/composer.json +++ b/src/Illuminate/View/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.0", + "php": "^7.1.3", "illuminate/container": "5.6.*", "illuminate/contracts": "5.6.*", "illuminate/events": "5.6.*", From 668dfb52c53fc965307a5c6fbecf05cd8cd10a0f Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 7 Nov 2017 20:35:29 +0000 Subject: [PATCH 53/66] Tweaked async signals branching logic --- src/Illuminate/Queue/Worker.php | 57 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index 7bbcd670296d..e699a1ac292e 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -84,7 +84,9 @@ public function __construct(QueueManager $manager, */ public function daemon($connectionName, $queue, WorkerOptions $options) { - $this->listenForSignals(); + if ($this->supportsAsyncSignals()) { + $this->listenForSignals(); + } $lastRestart = $this->getTimestampOfLastQueueRestart(); @@ -105,7 +107,9 @@ public function daemon($connectionName, $queue, WorkerOptions $options) $this->manager->connection($connectionName), $queue ); - $this->registerTimeoutHandler($job, $options); + if ($this->supportsAsyncSignals()) { + $this->registerTimeoutHandler($job, $options); + } // If the daemon should run (not in maintenance mode, etc.), then we can run // fire off this job for processing. Otherwise, we will need to sleep the @@ -124,7 +128,7 @@ public function daemon($connectionName, $queue, WorkerOptions $options) } /** - * Register the worker timeout handler (PHP 7.1+). + * Register the worker timeout handler. * * @param \Illuminate\Contracts\Queue\Job|null $job * @param \Illuminate\Queue\WorkerOptions $options @@ -132,18 +136,16 @@ public function daemon($connectionName, $queue, WorkerOptions $options) */ protected function registerTimeoutHandler($job, WorkerOptions $options) { - if ($this->supportsAsyncSignals()) { - // We will register a signal handler for the alarm signal so that we can kill this - // process if it is running too long because it has frozen. This uses the async - // signals supported in recent versions of PHP to accomplish it conveniently. - pcntl_signal(SIGALRM, function () { - $this->kill(1); - }); - - pcntl_alarm( - max($this->timeoutForJob($job, $options), 0) - ); - } + // We will register a signal handler for the alarm signal so that we can kill this + // process if it is running too long because it has frozen. This uses the async + // signals supported in recent versions of PHP to accomplish it conveniently. + pcntl_signal(SIGALRM, function () { + $this->kill(1); + }); + + pcntl_alarm( + max($this->timeoutForJob($job, $options), 0) + ); } /** @@ -506,21 +508,19 @@ protected function getTimestampOfLastQueueRestart() */ protected function listenForSignals() { - if ($this->supportsAsyncSignals()) { - pcntl_async_signals(true); + pcntl_async_signals(true); - pcntl_signal(SIGTERM, function () { - $this->shouldQuit = true; - }); + pcntl_signal(SIGTERM, function () { + $this->shouldQuit = true; + }); - pcntl_signal(SIGUSR2, function () { - $this->paused = true; - }); + pcntl_signal(SIGUSR2, function () { + $this->paused = true; + }); - pcntl_signal(SIGCONT, function () { - $this->paused = false; - }); - } + pcntl_signal(SIGCONT, function () { + $this->paused = false; + }); } /** @@ -530,8 +530,7 @@ protected function listenForSignals() */ protected function supportsAsyncSignals() { - return version_compare(PHP_VERSION, '7.1.0') >= 0 && - extension_loaded('pcntl'); + return extension_loaded('pcntl'); } /** From 53f638280a73c11731630b620a66d34d2f3af333 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Wed, 8 Nov 2017 13:58:28 +0000 Subject: [PATCH 54/66] Corrected testbench-core version (#21998) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 89174a274631..c24913e4e011 100644 --- a/composer.json +++ b/composer.json @@ -75,7 +75,7 @@ "doctrine/dbal": "~2.5", "filp/whoops": "^2.1.4", "mockery/mockery": "~1.0", - "orchestra/testbench-core": "3.5.*", + "orchestra/testbench-core": "3.6.*", "pda/pheanstalk": "~3.0", "phpunit/phpunit": "~6.0", "predis/predis": "^1.1.1", From b64fdac3283e733c5d3c75aaeda17e7fa3f41550 Mon Sep 17 00:00:00 2001 From: Joaquin Marcher Date: Wed, 8 Nov 2017 16:38:44 +0100 Subject: [PATCH 55/66] [5.5] Display Controller name on non existing methods (#22005) * [5.5] Display Controller name on non existing methods * Update Controller.php * Update Controller.php --- src/Illuminate/Routing/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Routing/Controller.php b/src/Illuminate/Routing/Controller.php index 24df5e418367..0a8a62c9709a 100644 --- a/src/Illuminate/Routing/Controller.php +++ b/src/Illuminate/Routing/Controller.php @@ -65,6 +65,6 @@ public function callAction($method, $parameters) */ public function __call($method, $parameters) { - throw new BadMethodCallException("Method [{$method}] does not exist."); + throw new BadMethodCallException("Method [{$method}] does not exist on [".get_class($this)."]."); } } From 27bb66632aa805a88474e4f8694864a6c7d4a5d6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 8 Nov 2017 09:38:58 -0600 Subject: [PATCH 56/66] Apply fixes from StyleCI (#22006) --- src/Illuminate/Routing/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Routing/Controller.php b/src/Illuminate/Routing/Controller.php index 0a8a62c9709a..bf4c8f1847f9 100644 --- a/src/Illuminate/Routing/Controller.php +++ b/src/Illuminate/Routing/Controller.php @@ -65,6 +65,6 @@ public function callAction($method, $parameters) */ public function __call($method, $parameters) { - throw new BadMethodCallException("Method [{$method}] does not exist on [".get_class($this)."]."); + throw new BadMethodCallException("Method [{$method}] does not exist on [".get_class($this).'].'); } } From ec68820d63dbe58851841043cedae90b0eed168d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 9 Nov 2017 08:49:08 +0800 Subject: [PATCH 57/66] Throws an exception if null driver is given. Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Support/Manager.php | 4 ++++ .../Support/Fixtures/NullableManager.php | 18 ++++++++++++++++++ tests/Integration/Support/ManagerTest.php | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 tests/Integration/Support/Fixtures/NullableManager.php create mode 100644 tests/Integration/Support/ManagerTest.php diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index 592776c2c859..e91268d530f9 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -56,6 +56,10 @@ public function driver($driver = null) { $driver = $driver ?: $this->getDefaultDriver(); + if (is_null($driver)) { + throw new InvalidArgumentException("Unable to resolve NULL driver for ".get_called_class()); + } + // If the given driver has not been created before, we will create the instances // here and cache it so we can return it next time very quickly. If there is // already a driver created by this name, we'll just return that instance. diff --git a/tests/Integration/Support/Fixtures/NullableManager.php b/tests/Integration/Support/Fixtures/NullableManager.php new file mode 100644 index 000000000000..09e3608ce73b --- /dev/null +++ b/tests/Integration/Support/Fixtures/NullableManager.php @@ -0,0 +1,18 @@ +app))->driver(); + } +} From dbc57637861305fb5d98bc0ab3ba072bdd71ab70 Mon Sep 17 00:00:00 2001 From: Matt Hanley Date: Thu, 9 Nov 2017 13:48:37 +0000 Subject: [PATCH 58/66] Add support for MultiSubnetFailover DSN parameter (#22022) --- src/Illuminate/Database/Connectors/SqlServerConnector.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Illuminate/Database/Connectors/SqlServerConnector.php b/src/Illuminate/Database/Connectors/SqlServerConnector.php index f9c4d0aafffa..deda5d72db01 100755 --- a/src/Illuminate/Database/Connectors/SqlServerConnector.php +++ b/src/Illuminate/Database/Connectors/SqlServerConnector.php @@ -134,6 +134,10 @@ protected function getSqlSrvDsn(array $config) $arguments['TransactionIsolation'] = $config['transaction_isolation']; } + if (isset($config['multi_subnet_failover'])) { + $arguments['MultiSubnetFailover'] = $config['multi_subnet_failover']; + } + return $this->buildConnectString('sqlsrv', $arguments); } From bb61e27cda62e12743e0a359e0f535c213a8f925 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 9 Nov 2017 07:51:32 -0600 Subject: [PATCH 59/66] formatting --- src/Illuminate/Support/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index e91268d530f9..f4f02f1a9b93 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -57,7 +57,7 @@ public function driver($driver = null) $driver = $driver ?: $this->getDefaultDriver(); if (is_null($driver)) { - throw new InvalidArgumentException("Unable to resolve NULL driver for ".get_called_class()); + throw new InvalidArgumentException("Unable to resolve NULL driver for [".get_class($this)."]."); } // If the given driver has not been created before, we will create the instances From 06f564717eb074242bff8b7bce34fd86e95f5cd6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 9 Nov 2017 07:51:52 -0600 Subject: [PATCH 60/66] Apply fixes from StyleCI (#22031) --- src/Illuminate/Support/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/Manager.php b/src/Illuminate/Support/Manager.php index f4f02f1a9b93..817a89795046 100755 --- a/src/Illuminate/Support/Manager.php +++ b/src/Illuminate/Support/Manager.php @@ -57,7 +57,7 @@ public function driver($driver = null) $driver = $driver ?: $this->getDefaultDriver(); if (is_null($driver)) { - throw new InvalidArgumentException("Unable to resolve NULL driver for [".get_class($this)."]."); + throw new InvalidArgumentException('Unable to resolve NULL driver for ['.get_class($this).'].'); } // If the given driver has not been created before, we will create the instances From da3b7081206266e7baa071676b50b354a374029e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 9 Nov 2017 07:51:54 -0600 Subject: [PATCH 61/66] remove message assertions --- tests/Integration/Support/ManagerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Integration/Support/ManagerTest.php b/tests/Integration/Support/ManagerTest.php index 76d7037de1a0..3a4334ec1797 100644 --- a/tests/Integration/Support/ManagerTest.php +++ b/tests/Integration/Support/ManagerTest.php @@ -8,7 +8,6 @@ class ManagerTest extends TestCase { /** * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unable to resolve NULL driver for Illuminate\Tests\Integration\Support\Fixtures\NullableManager */ public function testDefaultDriverCannotBeNull() { From 64ff11552cc4aa83bdb31d12cd13fabf085e51b8 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 9 Nov 2017 21:52:22 +0800 Subject: [PATCH 62/66] Set default hashing configuration to make it easier for existing Laravel (#22017) install to use new Hasher. Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Hashing/HashManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Hashing/HashManager.php b/src/Illuminate/Hashing/HashManager.php index 3f51c184e730..49c50407cd41 100644 --- a/src/Illuminate/Hashing/HashManager.php +++ b/src/Illuminate/Hashing/HashManager.php @@ -71,6 +71,6 @@ public function needsRehash($hashedValue, array $options = []) */ public function getDefaultDriver() { - return $this->app['config']['hashing.driver']; + return $this->app['config']['hashing.driver'] ?? 'bcrypt'; } } From 8be87d4cdf7b221a58f64fe87d61b1aad49f6f68 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Thu, 9 Nov 2017 15:55:31 +0200 Subject: [PATCH 63/66] [5.5] Ignore missing Dispatcher mock methods (#22012) * ignore missing Dispatcher mock methods * fix style --- .../Foundation/Testing/Concerns/MocksApplicationServices.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php b/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php index 04bb2aedd5bd..e0c48029fc64 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php +++ b/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php @@ -96,7 +96,7 @@ public function doesntExpectEvents($events) */ protected function withoutEvents() { - $mock = Mockery::mock(EventsDispatcherContract::class); + $mock = Mockery::mock(EventsDispatcherContract::class)->shouldIgnoreMissing(); $mock->shouldReceive('fire', 'dispatch')->andReturnUsing(function ($called) { $this->firedEvents[] = $called; From 7a322477934115b86dbd73953d15e61a929246f9 Mon Sep 17 00:00:00 2001 From: Johann Pardanaud Date: Thu, 9 Nov 2017 20:36:47 +0100 Subject: [PATCH 64/66] Support custom URLs for AWS storage --- .../Filesystem/FilesystemAdapter.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 84aa4b7dc568..b4398fd5cd79 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -350,6 +350,15 @@ public function url($path) */ protected function getAwsUrl($adapter, $path) { + $config = $this->driver->getConfig(); + + // 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 = $config->get('url'))) { + return $this->concatPathToUrl($url, $path); + } + return $adapter->getClient()->getObjectUrl( $adapter->getBucket(), $adapter->getPathPrefix().$path ); @@ -381,7 +390,7 @@ protected function getLocalUrl($path) // 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 ($config->has('url')) { - return rtrim($config->get('url'), '/').'/'.ltrim($path, '/'); + return $this->concatPathToUrl($config->get('url'), $path); } $path = '/storage/'.$path; @@ -460,6 +469,18 @@ public function getRackspaceTemporaryUrl($adapter, $path, $expiration, $options) ); } + /** + * Concatenate a path to a URL. + * + * @param string $url + * @param string $path + * @return string + */ + protected function concatPathToUrl($url, $path) + { + return rtrim($url, '/').'/'.ltrim($path, '/'); + } + /** * Get an array of all files in a directory. * From 26f16799c4de44ae09384058c71d5d28feb0af12 Mon Sep 17 00:00:00 2001 From: Antonio Carlos Ribeiro Date: Fri, 10 Nov 2017 12:22:23 -0200 Subject: [PATCH 65/66] Make Collection::dd() & Collection::dump() show the same result (#22036) --- src/Illuminate/Support/Collection.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index 13898792cbbd..d60747b633bb 100644 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -275,9 +275,11 @@ public function crossJoin(...$lists) * * @return void */ - public function dd() + public function dd(...$args) { - dd($this->all()); + call_user_func_array([$this, 'dump'], $args); + + die(1); } /** From 81e29b1f09af7095df219efd18185f0818f5b698 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 10 Nov 2017 11:10:11 -0600 Subject: [PATCH 66/66] allow bindings and singletons properties --- src/Illuminate/Foundation/Application.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index fbaade3f9609..78c4e05c57c1 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -586,15 +586,18 @@ public function register($provider, $options = [], $force = false) $provider->register(); } - if (property_exists($provider, 'bind')) { - foreach ($provider->bind as $abstract => $concrete) { - $this->bind($abstract, $concrete); + // If there are bindings / singletons set as properties on the provider we + // will spin through them and register them with the application, which + // serves as a convenience layer while registering a lot of bindings. + if (property_exists($provider, 'bindings')) { + foreach ($provider->bindings as $key => $value) { + $this->bind($key, $value); } } if (property_exists($provider, 'singletons')) { - foreach ($provider->singletons as $abstract => $concrete) { - $this->singleton($abstract, $concrete); + foreach ($provider->singletons as $key => $value) { + $this->singleton($key, $value); } }