From ff3df6773e74fd9dd61a3b7b44b50b2b793f5e11 Mon Sep 17 00:00:00 2001 From: Kelvin Jones Date: Mon, 27 Oct 2014 07:59:16 +0000 Subject: [PATCH 01/25] Use contract for MessageBag --- src/Illuminate/Support/ViewErrorBag.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Support/ViewErrorBag.php b/src/Illuminate/Support/ViewErrorBag.php index a7a474a6571e..99bcb6dd1769 100644 --- a/src/Illuminate/Support/ViewErrorBag.php +++ b/src/Illuminate/Support/ViewErrorBag.php @@ -1,6 +1,7 @@ bags[$key] = $bag; @@ -73,7 +74,7 @@ public function __call($method, $parameters) * Dynamically access a view error bag. * * @param string $key - * @return \Illuminate\Support\MessageBag + * @return \Illuminate\Contracts\Support\MessageBag */ public function __get($key) { @@ -84,7 +85,7 @@ public function __get($key) * Dynamically set a view error bag. * * @param string $key - * @param \Illuminate\Support\MessageBag $value + * @param \Illuminate\Contracts\Support\MessageBag $value * @return void */ public function __set($key, $value) From 39e4f7bfe58513e936c1d42f9a9cb360d0ca260d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 28 Oct 2014 13:44:22 +0000 Subject: [PATCH 02/25] Only flush the app if it exists --- src/Illuminate/Foundation/Testing/TestCase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/TestCase.php b/src/Illuminate/Foundation/Testing/TestCase.php index 7462e2d4511c..cbdedd6249ff 100755 --- a/src/Illuminate/Foundation/Testing/TestCase.php +++ b/src/Illuminate/Foundation/Testing/TestCase.php @@ -33,7 +33,10 @@ public function setUp() */ public function tearDown() { - $this->app->flush(); + if ($this->app) + { + $this->app->flush(); + } } } From 9734b100ad08d25929102ad334e98310be493692 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Thu, 30 Oct 2014 10:36:51 +0100 Subject: [PATCH 03/25] Fix try/catch formatting --- src/Illuminate/Cookie/Middleware/EncryptCookies.php | 7 +++++-- src/Illuminate/Events/Annotations/Scanner.php | 7 +++++-- src/Illuminate/Routing/Annotations/Scanner.php | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Cookie/Middleware/EncryptCookies.php b/src/Illuminate/Cookie/Middleware/EncryptCookies.php index 67bb90ed1c81..1ffdbeccb975 100644 --- a/src/Illuminate/Cookie/Middleware/EncryptCookies.php +++ b/src/Illuminate/Cookie/Middleware/EncryptCookies.php @@ -50,9 +50,12 @@ protected function decrypt(Request $request) { foreach ($request->cookies as $key => $c) { - try { + try + { $request->cookies->set($key, $this->decryptCookie($c)); - } catch (DecryptException $e) { + } + catch (DecryptException $e) + { $request->cookies->set($key, null); } } diff --git a/src/Illuminate/Events/Annotations/Scanner.php b/src/Illuminate/Events/Annotations/Scanner.php index 4dccfac931ef..157cf2b4fba4 100644 --- a/src/Illuminate/Events/Annotations/Scanner.php +++ b/src/Illuminate/Events/Annotations/Scanner.php @@ -90,9 +90,12 @@ protected function getClassesToScan() foreach ($this->scan as $class) { - try { + try + { $classes[] = new ReflectionClass($class); - } catch (\Exception $e) { + } + catch (\Exception $e) + { // } } diff --git a/src/Illuminate/Routing/Annotations/Scanner.php b/src/Illuminate/Routing/Annotations/Scanner.php index 35865623faae..3f6d78053dd8 100644 --- a/src/Illuminate/Routing/Annotations/Scanner.php +++ b/src/Illuminate/Routing/Annotations/Scanner.php @@ -129,9 +129,12 @@ protected function getClassesToScan() foreach ($this->scan as $scan) { - try { + try + { $classes[] = new ReflectionClass($scan); - } catch (\Exception $e) { + } + catch (\Exception $e) + { // } } From df7cbbecedb606d4836382451436c474fff0cd84 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Thu, 30 Oct 2014 10:39:20 +0100 Subject: [PATCH 04/25] Enforce short array notations in stub files --- src/Illuminate/Foundation/Console/stubs/command.stub | 12 ++++++------ src/Illuminate/Workbench/stubs/plain.provider.stub | 2 +- src/Illuminate/Workbench/stubs/provider.stub | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Foundation/Console/stubs/command.stub b/src/Illuminate/Foundation/Console/stubs/command.stub index ac88a8de7a66..0899c8bc3d50 100755 --- a/src/Illuminate/Foundation/Console/stubs/command.stub +++ b/src/Illuminate/Foundation/Console/stubs/command.stub @@ -47,9 +47,9 @@ class {{class}} extends Command { */ protected function getArguments() { - return array( - array('example', InputArgument::REQUIRED, 'An example argument.'), - ); + return [ + ['example', InputArgument::REQUIRED, 'An example argument.'], + ]; } /** @@ -59,9 +59,9 @@ class {{class}} extends Command { */ protected function getOptions() { - return array( - array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null), - ); + return [ + ['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null], + ]; } } diff --git a/src/Illuminate/Workbench/stubs/plain.provider.stub b/src/Illuminate/Workbench/stubs/plain.provider.stub index 68f4abcf4cb6..224397b5f636 100755 --- a/src/Illuminate/Workbench/stubs/plain.provider.stub +++ b/src/Illuminate/Workbench/stubs/plain.provider.stub @@ -28,7 +28,7 @@ class {{name}}ServiceProvider extends ServiceProvider { */ public function provides() { - return array(); + return []; } } diff --git a/src/Illuminate/Workbench/stubs/provider.stub b/src/Illuminate/Workbench/stubs/provider.stub index a39ecafbdb96..f5c81d0938f8 100755 --- a/src/Illuminate/Workbench/stubs/provider.stub +++ b/src/Illuminate/Workbench/stubs/provider.stub @@ -38,7 +38,7 @@ class {{name}}ServiceProvider extends ServiceProvider { */ public function provides() { - return array(); + return []; } } From 79c1d50b4e53ab00a38b5c2e443fce88ee1fb528 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Thu, 30 Oct 2014 00:56:20 +0100 Subject: [PATCH 05/25] Fix various docblocks --- src/Illuminate/Console/AppNamespaceDetectorTrait.php | 3 ++- src/Illuminate/Events/Annotations/Annotations/Hears.php | 1 + src/Illuminate/Events/Annotations/Scanner.php | 7 +++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Console/AppNamespaceDetectorTrait.php b/src/Illuminate/Console/AppNamespaceDetectorTrait.php index 61faea4de64c..a36b7c82123f 100644 --- a/src/Illuminate/Console/AppNamespaceDetectorTrait.php +++ b/src/Illuminate/Console/AppNamespaceDetectorTrait.php @@ -5,8 +5,9 @@ trait AppNamespaceDetectorTrait { /** * Get the application namespace from the Composer file. * - * @param string $namespacePath * @return string + * + * @throws \RuntimeException */ protected function getAppNamespace() { diff --git a/src/Illuminate/Events/Annotations/Annotations/Hears.php b/src/Illuminate/Events/Annotations/Annotations/Hears.php index f48b186c2c7d..e0f8db417e6a 100644 --- a/src/Illuminate/Events/Annotations/Annotations/Hears.php +++ b/src/Illuminate/Events/Annotations/Annotations/Hears.php @@ -15,6 +15,7 @@ class Hears { /** * Create a new annotation instance. * + * @param array $values * @return void */ public function __construct(array $values = array()) diff --git a/src/Illuminate/Events/Annotations/Scanner.php b/src/Illuminate/Events/Annotations/Scanner.php index 4dccfac931ef..157cf2b4fba4 100644 --- a/src/Illuminate/Events/Annotations/Scanner.php +++ b/src/Illuminate/Events/Annotations/Scanner.php @@ -90,9 +90,12 @@ protected function getClassesToScan() foreach ($this->scan as $class) { - try { + try + { $classes[] = new ReflectionClass($class); - } catch (\Exception $e) { + } + catch (\Exception $e) + { // } } From 84cfbb7ea0d5d5e774ef4a7029d3e5932601eb0a Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 30 Oct 2014 15:22:09 +0100 Subject: [PATCH 06/25] Use Container contract. --- src/Illuminate/Validation/Factory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Validation/Factory.php b/src/Illuminate/Validation/Factory.php index 0b6b1c4f71f0..b38624c83dfd 100755 --- a/src/Illuminate/Validation/Factory.php +++ b/src/Illuminate/Validation/Factory.php @@ -1,7 +1,7 @@ Date: Thu, 30 Oct 2014 15:26:43 +0100 Subject: [PATCH 07/25] Use Container contract, add class member. --- src/Illuminate/Validation/Validator.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index 107cf5c23d20..fe08ef1aba67 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -5,7 +5,7 @@ use DateTimeZone; use Illuminate\Support\Fluent; use Illuminate\Support\MessageBag; -use Illuminate\Container\Container; +use Illuminate\Contracts\Container\Container; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -27,6 +27,13 @@ class Validator implements ValidatorContract { */ protected $presenceVerifier; + /** + * The container instance. + * + * @var \Illuminate\Contracts\Container\Container + */ + protected $container; + /** * The failed validation rules. * @@ -2434,7 +2441,7 @@ public function getMessageBag() /** * Set the IoC container instance. * - * @param \Illuminate\Container\Container $container + * @param \Illuminate\Contracts\Container\Container $container * @return void */ public function setContainer(Container $container) From b7b632c2538209a4c4ba8f7407f678ade9256dd5 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 30 Oct 2014 15:30:47 +0100 Subject: [PATCH 08/25] Remove leftover variable. --- src/Illuminate/Database/DatabaseManager.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Illuminate/Database/DatabaseManager.php b/src/Illuminate/Database/DatabaseManager.php index ddade604eaea..3b8693b92810 100755 --- a/src/Illuminate/Database/DatabaseManager.php +++ b/src/Illuminate/Database/DatabaseManager.php @@ -191,9 +191,6 @@ protected function prepare(Connection $connection) $connection->setEventDispatcher($this->app['events']); } - $app = $this->app; - - // Here we'll set a reconnector callback. This reconnector can be any callable // so we will set a Closure to reconnect from this manager with the name of // the connection, which will allow us to reconnect from the connections. From 6980562a507693630bc7572c9756c0dee4a0ce7c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 30 Oct 2014 16:50:56 +0100 Subject: [PATCH 09/25] Use Container contract. --- src/Illuminate/Database/Connectors/ConnectionFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Database/Connectors/ConnectionFactory.php b/src/Illuminate/Database/Connectors/ConnectionFactory.php index 17df20cf5fb8..fe3fe5d72e68 100755 --- a/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -1,7 +1,7 @@ Date: Thu, 30 Oct 2014 17:01:09 +0100 Subject: [PATCH 10/25] Prettiness. --- src/Illuminate/Database/Connectors/ConnectionFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Connectors/ConnectionFactory.php b/src/Illuminate/Database/Connectors/ConnectionFactory.php index fe3fe5d72e68..da2d3ff1c78f 100755 --- a/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -1,11 +1,11 @@ Date: Fri, 31 Oct 2014 13:56:14 +0000 Subject: [PATCH 11/25] Remove unused $changeHistory variable --- src/Illuminate/Foundation/Testing/ApplicationTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/ApplicationTrait.php b/src/Illuminate/Foundation/Testing/ApplicationTrait.php index 53fff0ae7cc3..ba1fd45804c9 100644 --- a/src/Illuminate/Foundation/Testing/ApplicationTrait.php +++ b/src/Illuminate/Foundation/Testing/ApplicationTrait.php @@ -98,7 +98,7 @@ public function route($method, $name, $routeParameters = [], $parameters = [], $ { $uri = $this->app['url']->route($name, $routeParameters); - return $this->call($method, $uri, $parameters, $cookies, $files, $server, $content, $changeHistory); + return $this->call($method, $uri, $parameters, $cookies, $files, $server, $content); } /** From b4c5cb0e8804607f1240bee9b0de0a007985751a Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sun, 2 Nov 2014 13:58:00 +0100 Subject: [PATCH 12/25] Add required description to all composer.json files --- src/Illuminate/Auth/composer.json | 1 + src/Illuminate/Cache/composer.json | 1 + src/Illuminate/Config/composer.json | 1 + src/Illuminate/Console/composer.json | 1 + src/Illuminate/Container/composer.json | 1 + src/Illuminate/Contracts/composer.json | 1 + src/Illuminate/Cookie/composer.json | 1 + src/Illuminate/Database/composer.json | 1 + src/Illuminate/Encryption/composer.json | 1 + src/Illuminate/Events/composer.json | 1 + src/Illuminate/Filesystem/composer.json | 1 + src/Illuminate/Hashing/composer.json | 1 + src/Illuminate/Http/composer.json | 1 + src/Illuminate/Log/composer.json | 1 + src/Illuminate/Mail/composer.json | 1 + src/Illuminate/Pagination/composer.json | 1 + src/Illuminate/Queue/composer.json | 1 + src/Illuminate/Redis/composer.json | 1 + src/Illuminate/Routing/composer.json | 1 + src/Illuminate/Session/composer.json | 1 + src/Illuminate/Support/composer.json | 1 + src/Illuminate/Translation/composer.json | 1 + src/Illuminate/Validation/composer.json | 1 + src/Illuminate/View/composer.json | 1 + src/Illuminate/Workbench/composer.json | 1 + 25 files changed, 25 insertions(+) diff --git a/src/Illuminate/Auth/composer.json b/src/Illuminate/Auth/composer.json index 17385b4919ac..ea5b4b29f3b2 100755 --- a/src/Illuminate/Auth/composer.json +++ b/src/Illuminate/Auth/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/auth", + "description": "The Illuminate Auth package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Cache/composer.json b/src/Illuminate/Cache/composer.json index 10556bc29af1..94b33893026f 100755 --- a/src/Illuminate/Cache/composer.json +++ b/src/Illuminate/Cache/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/cache", + "description": "The Illuminate Cache package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Config/composer.json b/src/Illuminate/Config/composer.json index 07ab32b1acee..ddf78a347d10 100755 --- a/src/Illuminate/Config/composer.json +++ b/src/Illuminate/Config/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/config", + "description": "The Illuminate Config package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Console/composer.json b/src/Illuminate/Console/composer.json index f79b22cd5af9..526d967411d7 100755 --- a/src/Illuminate/Console/composer.json +++ b/src/Illuminate/Console/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/console", + "description": "The Illuminate Console package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Container/composer.json b/src/Illuminate/Container/composer.json index 20fdbff604ce..0f8e421cd0fe 100755 --- a/src/Illuminate/Container/composer.json +++ b/src/Illuminate/Container/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/container", + "description": "The Illuminate Container package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Contracts/composer.json b/src/Illuminate/Contracts/composer.json index f3179a2c7022..f460f8c5bad7 100644 --- a/src/Illuminate/Contracts/composer.json +++ b/src/Illuminate/Contracts/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/contracts", + "description": "The Illuminate Contracts package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Cookie/composer.json b/src/Illuminate/Cookie/composer.json index d4df097b1010..90f883a1f295 100755 --- a/src/Illuminate/Cookie/composer.json +++ b/src/Illuminate/Cookie/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/cookie", + "description": "The Illuminate Cookie package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Database/composer.json b/src/Illuminate/Database/composer.json index d3f293f6c645..bd623822959b 100755 --- a/src/Illuminate/Database/composer.json +++ b/src/Illuminate/Database/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/database", + "description": "The Illuminate Database package.", "license": "MIT", "keywords": ["laravel", "database", "sql", "orm"], "authors": [ diff --git a/src/Illuminate/Encryption/composer.json b/src/Illuminate/Encryption/composer.json index 966d972d3bf1..6a5953e020ed 100755 --- a/src/Illuminate/Encryption/composer.json +++ b/src/Illuminate/Encryption/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/encryption", + "description": "The Illuminate Encryption package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Events/composer.json b/src/Illuminate/Events/composer.json index 58b4e9aa6ddf..58ef6899eed9 100755 --- a/src/Illuminate/Events/composer.json +++ b/src/Illuminate/Events/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/events", + "description": "The Illuminate Events package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Filesystem/composer.json b/src/Illuminate/Filesystem/composer.json index 8aebca84a9db..282d12e948b7 100755 --- a/src/Illuminate/Filesystem/composer.json +++ b/src/Illuminate/Filesystem/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/filesystem", + "description": "The Illuminate Filesystem package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Hashing/composer.json b/src/Illuminate/Hashing/composer.json index 7c7407aecce8..65fbfd527a26 100755 --- a/src/Illuminate/Hashing/composer.json +++ b/src/Illuminate/Hashing/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/hashing", + "description": "The Illuminate Hashing package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Http/composer.json b/src/Illuminate/Http/composer.json index b2ebb4fb1fbd..2d680b972176 100755 --- a/src/Illuminate/Http/composer.json +++ b/src/Illuminate/Http/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/http", + "description": "The Illuminate Http package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Log/composer.json b/src/Illuminate/Log/composer.json index 27f04211f92c..5ca006ae5ecd 100755 --- a/src/Illuminate/Log/composer.json +++ b/src/Illuminate/Log/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/log", + "description": "The Illuminate Log package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Mail/composer.json b/src/Illuminate/Mail/composer.json index 5848c3b05248..1468a2c1e7c7 100755 --- a/src/Illuminate/Mail/composer.json +++ b/src/Illuminate/Mail/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/mail", + "description": "The Illuminate Mail package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Pagination/composer.json b/src/Illuminate/Pagination/composer.json index 48a2d204f161..294c06c66b38 100755 --- a/src/Illuminate/Pagination/composer.json +++ b/src/Illuminate/Pagination/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/pagination", + "description": "The Illuminate Pagination package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Queue/composer.json b/src/Illuminate/Queue/composer.json index bc6cb5d72398..d43bd3498a42 100755 --- a/src/Illuminate/Queue/composer.json +++ b/src/Illuminate/Queue/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/queue", + "description": "The Illuminate Queue package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Redis/composer.json b/src/Illuminate/Redis/composer.json index c56386d82cc3..22200fd524e0 100755 --- a/src/Illuminate/Redis/composer.json +++ b/src/Illuminate/Redis/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/redis", + "description": "The Illuminate Redis package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Routing/composer.json b/src/Illuminate/Routing/composer.json index 8b5ec33a4141..b126393fb6a5 100755 --- a/src/Illuminate/Routing/composer.json +++ b/src/Illuminate/Routing/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/routing", + "description": "The Illuminate Routing package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Session/composer.json b/src/Illuminate/Session/composer.json index b1c17a18439c..c6fc4e1c026b 100755 --- a/src/Illuminate/Session/composer.json +++ b/src/Illuminate/Session/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/session", + "description": "The Illuminate Session package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Support/composer.json b/src/Illuminate/Support/composer.json index ab413fb4d4ab..b847ec71e0ca 100755 --- a/src/Illuminate/Support/composer.json +++ b/src/Illuminate/Support/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/support", + "description": "The Illuminate Support package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Translation/composer.json b/src/Illuminate/Translation/composer.json index c75ad0df0d90..56513f27ae6e 100755 --- a/src/Illuminate/Translation/composer.json +++ b/src/Illuminate/Translation/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/translation", + "description": "The Illuminate Translation package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Validation/composer.json b/src/Illuminate/Validation/composer.json index f85ffaacf2b1..8bab941a3b74 100755 --- a/src/Illuminate/Validation/composer.json +++ b/src/Illuminate/Validation/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/validation", + "description": "The Illuminate Validation package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/View/composer.json b/src/Illuminate/View/composer.json index 7199565b472e..58cfb2060656 100755 --- a/src/Illuminate/View/composer.json +++ b/src/Illuminate/View/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/view", + "description": "The Illuminate View package.", "license": "MIT", "authors": [ { diff --git a/src/Illuminate/Workbench/composer.json b/src/Illuminate/Workbench/composer.json index 50f5987ec51b..0d6553be71d6 100755 --- a/src/Illuminate/Workbench/composer.json +++ b/src/Illuminate/Workbench/composer.json @@ -1,5 +1,6 @@ { "name": "illuminate/workbench", + "description": "The Illuminate Workbench package.", "license": "MIT", "authors": [ { From 2bf2b1680b7d70a9ed9aa11ac271e10c26ccc4c7 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sun, 2 Nov 2014 14:48:48 +0100 Subject: [PATCH 13/25] Simplify log levels --- src/Illuminate/Log/Writer.php | 47 ++++++++++++++--------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php index b680aa04bea8..40b035eb24d5 100755 --- a/src/Illuminate/Log/Writer.php +++ b/src/Illuminate/Log/Writer.php @@ -28,6 +28,22 @@ class Writer implements LogContract, PsrLoggerInterface { */ protected $dispatcher; + /** + * The Log levels. + * + * @var array + */ + protected $levels = [ + 'debug' => MonologLogger::DEBUG, + 'info' => MonologLogger::INFO, + 'notice' => MonologLogger::NOTICE, + 'warning' => MonologLogger::WARNING, + 'error' => MonologLogger::ERROR, + 'critical' => MonologLogger::CRITICAL, + 'alert' => MonologLogger::ALERT, + 'emergency' => MonologLogger::EMERGENCY, + ]; + /** * Create a new log writer instance. * @@ -300,35 +316,10 @@ protected function formatMessage($message) */ protected function parseLevel($level) { - switch ($level) + return array_get($this->levels, $level, function () { - case 'debug': - return MonologLogger::DEBUG; - - case 'info': - return MonologLogger::INFO; - - case 'notice': - return MonologLogger::NOTICE; - - case 'warning': - return MonologLogger::WARNING; - - case 'error': - return MonologLogger::ERROR; - - case 'critical': - return MonologLogger::CRITICAL; - - case 'alert': - return MonologLogger::ALERT; - - case 'emergency': - return MonologLogger::EMERGENCY; - - default: - throw new \InvalidArgumentException("Invalid log level."); - } + throw new \InvalidArgumentException("Invalid log level."); + }); } /** From 1ea26cde6b0e3a9f06683674d10119f7d9a9c850 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 2 Nov 2014 18:00:52 +0100 Subject: [PATCH 14/25] Fix RoutingAnnotationScannerTest on Windows. --- tests/Routing/RoutingAnnotationScannerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Routing/RoutingAnnotationScannerTest.php b/tests/Routing/RoutingAnnotationScannerTest.php index 5dca960ab40d..24b2d26a4cde 100644 --- a/tests/Routing/RoutingAnnotationScannerTest.php +++ b/tests/Routing/RoutingAnnotationScannerTest.php @@ -8,7 +8,7 @@ public function testProperRouteDefinitionsAreGenerated() { require_once __DIR__.'/fixtures/annotations/BasicController.php'; $scanner = Scanner::create(['App\Http\Controllers\BasicController']); - $definition = $scanner->getRouteDefinitions(); + $definition = str_replace(PHP_EOL, "\n", $scanner->getRouteDefinitions()); $this->assertEquals(trim(file_get_contents(__DIR__.'/results/annotation-basic.php')), $definition); } From 98e1357473e987ac85353629c9c97d68a5dcc9ef Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sun, 2 Nov 2014 21:48:08 +0100 Subject: [PATCH 15/25] update parseLevel --- src/Illuminate/Log/Writer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php index 40b035eb24d5..a82ccb32118f 100755 --- a/src/Illuminate/Log/Writer.php +++ b/src/Illuminate/Log/Writer.php @@ -316,10 +316,12 @@ protected function formatMessage($message) */ protected function parseLevel($level) { - return array_get($this->levels, $level, function () + if (isset($this->levels[$level])) { - throw new \InvalidArgumentException("Invalid log level."); - }); + return $this->levels[$level]; + } + + throw new \InvalidArgumentException("Invalid log level."); } /** From 3fc7456644c2a4102bb0a350fbab5cc4a8d4bf36 Mon Sep 17 00:00:00 2001 From: Hannes Van De Vreken Date: Mon, 3 Nov 2014 17:14:23 +0100 Subject: [PATCH 16/25] Typo --- src/Illuminate/Validation/ValidationServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Validation/ValidationServiceProvider.php b/src/Illuminate/Validation/ValidationServiceProvider.php index 09f5bd8a011f..a37c5c5ceedf 100755 --- a/src/Illuminate/Validation/ValidationServiceProvider.php +++ b/src/Illuminate/Validation/ValidationServiceProvider.php @@ -12,7 +12,7 @@ class ValidationServiceProvider extends ServiceProvider { */ public function register() { - $this->registerValiationResolverHook(); + $this->registerValidationResolverHook(); $this->registerPresenceVerifier(); @@ -24,7 +24,7 @@ public function register() * * @return void */ - protected function registerValiationResolverHook() + protected function registerValidationResolverHook() { $this->app->afterResolvingAny(function($resolved) { From ff72af6ea6c44850c00bfa105fad50927ec8d2db Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 3 Nov 2014 23:47:39 +0100 Subject: [PATCH 17/25] Use the Symfony session interface. --- src/Illuminate/Auth/Guard.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Auth/Guard.php b/src/Illuminate/Auth/Guard.php index bac39045f200..b99bb0da7d64 100755 --- a/src/Illuminate/Auth/Guard.php +++ b/src/Illuminate/Auth/Guard.php @@ -2,11 +2,11 @@ use Illuminate\Contracts\Events\Dispatcher; use Symfony\Component\HttpFoundation\Request; -use Illuminate\Session\Store as SessionStore; use Symfony\Component\HttpFoundation\Response; use Illuminate\Contracts\Auth\User as UserContract; use Illuminate\Contracts\Auth\Guard as GuardContract; use Illuminate\Contracts\Cookie\QueueingFactory as CookieJar; +use Symfony\Component\HttpFoundation\Session\SessionInterface; class Guard implements GuardContract { @@ -39,9 +39,9 @@ class Guard implements GuardContract { protected $provider; /** - * The session store used by the guard. + * The session used by the guard. * - * @var \Illuminate\Session\Store + * @var \Symfony\Component\HttpFoundation\Session\SessionInterface */ protected $session; @@ -84,12 +84,12 @@ class Guard implements GuardContract { * Create a new authentication guard. * * @param \Illuminate\Auth\UserProviderInterface $provider - * @param \Illuminate\Session\Store $session + * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ public function __construct(UserProviderInterface $provider, - SessionStore $session, + SessionInterface $session, Request $request = null) { $this->session = $session; @@ -439,7 +439,7 @@ public function login(UserContract $user, $remember = false) */ protected function updateSession($id) { - $this->session->put($this->getName(), $id); + $this->session->set($this->getName(), $id); $this->session->migrate(true); } @@ -453,7 +453,7 @@ protected function updateSession($id) */ public function loginUsingId($id, $remember = false) { - $this->session->put($this->getName(), $id); + $this->session->set($this->getName(), $id); $this->login($user = $this->provider->retrieveById($id), $remember); @@ -536,7 +536,7 @@ public function logout() */ protected function clearUserDataFromStorage() { - $this->session->forget($this->getName()); + $this->session->remove($this->getName()); $recaller = $this->getRecallerName(); From 982c68121c2645a6ec812b6a5eae1b0244e16094 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 4 Nov 2014 00:03:38 +0100 Subject: [PATCH 18/25] Use correct interface in tests. --- tests/Auth/AuthGuardTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Auth/AuthGuardTest.php b/tests/Auth/AuthGuardTest.php index c1a094429040..4f0ea4dcbb92 100755 --- a/tests/Auth/AuthGuardTest.php +++ b/tests/Auth/AuthGuardTest.php @@ -93,7 +93,7 @@ public function testLoginStoresIdentifierInSession() $user = m::mock('Illuminate\Contracts\Auth\User'); $mock->expects($this->once())->method('getName')->will($this->returnValue('foo')); $user->shouldReceive('getAuthIdentifier')->once()->andReturn('bar'); - $mock->getSession()->shouldReceive('put')->with('foo', 'bar')->once(); + $mock->getSession()->shouldReceive('set')->with('foo', 'bar')->once(); $session->shouldReceive('migrate')->once(); $mock->login($user); } @@ -108,7 +108,7 @@ public function testLoginFiresLoginEvent() $events->shouldReceive('fire')->once()->with('auth.login', array($user, false)); $mock->expects($this->once())->method('getName')->will($this->returnValue('foo')); $user->shouldReceive('getAuthIdentifier')->once()->andReturn('bar'); - $mock->getSession()->shouldReceive('put')->with('foo', 'bar')->once(); + $mock->getSession()->shouldReceive('set')->with('foo', 'bar')->once(); $session->shouldReceive('migrate')->once(); $mock->login($user); } @@ -176,7 +176,7 @@ public function testLogoutRemovesSessionTokenAndRememberMeCookie() $cookie = m::mock('Symfony\Component\HttpFoundation\Cookie'); $cookies->shouldReceive('forget')->once()->with('bar')->andReturn($cookie); $cookies->shouldReceive('queue')->once()->with($cookie); - $mock->getSession()->shouldReceive('forget')->once()->with('foo'); + $mock->getSession()->shouldReceive('remove')->once()->with('foo'); $mock->setUser($user); $mock->logout(); $this->assertNull($mock->getUser()); @@ -206,7 +206,7 @@ public function testLoginMethodQueuesCookieWhenRemembering() $foreverCookie = new Symfony\Component\HttpFoundation\Cookie($guard->getRecallerName(), 'foo'); $cookie->shouldReceive('forever')->once()->with($guard->getRecallerName(), 'foo|recaller')->andReturn($foreverCookie); $cookie->shouldReceive('queue')->once()->with($foreverCookie); - $guard->getSession()->shouldReceive('put')->once()->with($guard->getName(), 'foo'); + $guard->getSession()->shouldReceive('set')->once()->with($guard->getName(), 'foo'); $session->shouldReceive('migrate')->once(); $user = m::mock('Illuminate\Contracts\Auth\User'); $user->shouldReceive('getAuthIdentifier')->andReturn('foo'); @@ -225,7 +225,7 @@ public function testLoginMethodCreatesRememberTokenIfOneDoesntExist() $foreverCookie = new Symfony\Component\HttpFoundation\Cookie($guard->getRecallerName(), 'foo'); $cookie->shouldReceive('forever')->once()->andReturn($foreverCookie); $cookie->shouldReceive('queue')->once()->with($foreverCookie); - $guard->getSession()->shouldReceive('put')->once()->with($guard->getName(), 'foo'); + $guard->getSession()->shouldReceive('set')->once()->with($guard->getName(), 'foo'); $session->shouldReceive('migrate')->once(); $user = m::mock('Illuminate\Contracts\Auth\User'); $user->shouldReceive('getAuthIdentifier')->andReturn('foo'); @@ -240,7 +240,7 @@ public function testLoginUsingIdStoresInSessionAndLogsInWithUser() { list($session, $provider, $request, $cookie) = $this->getMocks(); $guard = $this->getMock('Illuminate\Auth\Guard', array('login', 'user'), array($provider, $session, $request)); - $guard->getSession()->shouldReceive('put')->once()->with($guard->getName(), 10); + $guard->getSession()->shouldReceive('set')->once()->with($guard->getName(), 10); $guard->getProvider()->shouldReceive('retrieveById')->once()->with(10)->andReturn($user = m::mock('Illuminate\Contracts\Auth\User')); $guard->expects($this->once())->method('login')->with($this->equalTo($user), $this->equalTo(false))->will($this->returnValue($user)); @@ -272,7 +272,7 @@ protected function getGuard() protected function getMocks() { return array( - m::mock('Illuminate\Session\Store'), + m::mock('Symfony\Component\HttpFoundation\Session\SessionInterface'), m::mock('Illuminate\Auth\UserProviderInterface'), Symfony\Component\HttpFoundation\Request::create('/', 'GET'), m::mock('Illuminate\Cookie\CookieJar'), From e989e173252e38eb41def4d0d85241dd28ab38bd Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 4 Nov 2014 00:30:18 +0100 Subject: [PATCH 19/25] Replace bindShared() with singleton(). --- src/Illuminate/Auth/AuthServiceProvider.php | 4 +-- .../Auth/GeneratorServiceProvider.php | 2 +- .../PasswordResetServiceProvider.php | 4 +-- src/Illuminate/Cache/CacheServiceProvider.php | 10 +++--- .../Cookie/CookieServiceProvider.php | 2 +- .../Database/DatabaseServiceProvider.php | 6 ++-- .../Database/MigrationServiceProvider.php | 20 +++++------ .../Database/SeedServiceProvider.php | 4 +-- .../Encryption/EncryptionServiceProvider.php | 2 +- .../Filesystem/FilesystemServiceProvider.php | 8 ++--- .../Providers/ArtisanServiceProvider.php | 36 +++++++++---------- .../Providers/ComposerServiceProvider.php | 4 +-- .../Providers/PublisherServiceProvider.php | 16 ++++----- .../Hashing/HashServiceProvider.php | 2 +- src/Illuminate/Mail/MailServiceProvider.php | 2 +- .../Queue/FailConsoleServiceProvider.php | 10 +++--- src/Illuminate/Queue/QueueServiceProvider.php | 20 +++++------ src/Illuminate/Redis/RedisServiceProvider.php | 2 +- .../Routing/GeneratorServiceProvider.php | 4 +-- .../Routing/RoutingServiceProvider.php | 2 +- .../Session/CommandsServiceProvider.php | 2 +- .../Session/SessionServiceProvider.php | 4 +-- .../TranslationServiceProvider.php | 4 +-- .../Validation/ValidationServiceProvider.php | 4 +-- src/Illuminate/View/ViewServiceProvider.php | 8 ++--- .../Workbench/WorkbenchServiceProvider.php | 4 +-- .../Foundation/FoundationApplicationTest.php | 6 ++-- 27 files changed, 96 insertions(+), 96 deletions(-) diff --git a/src/Illuminate/Auth/AuthServiceProvider.php b/src/Illuminate/Auth/AuthServiceProvider.php index 581d463bb569..28ecb84cacd1 100755 --- a/src/Illuminate/Auth/AuthServiceProvider.php +++ b/src/Illuminate/Auth/AuthServiceProvider.php @@ -25,7 +25,7 @@ public function register() */ protected function registerAuthenticator() { - $this->app->bindShared('auth', function($app) + $this->app->singleton('auth', function($app) { // Once the authentication service has actually been requested by the developer // we will set a variable in the application indicating such. This helps us @@ -35,7 +35,7 @@ protected function registerAuthenticator() return new AuthManager($app); }); - $this->app->bindShared('auth.driver', function($app) + $this->app->singleton('auth.driver', function($app) { return $app['auth']->driver(); }); diff --git a/src/Illuminate/Auth/GeneratorServiceProvider.php b/src/Illuminate/Auth/GeneratorServiceProvider.php index d8fde267e96a..1bcaddc7825d 100644 --- a/src/Illuminate/Auth/GeneratorServiceProvider.php +++ b/src/Illuminate/Auth/GeneratorServiceProvider.php @@ -45,7 +45,7 @@ public function register() */ protected function registerClearRemindersCommand() { - $this->app->bindShared('command.auth.reminders.clear', function() + $this->app->singleton('command.auth.reminders.clear', function() { return new ClearRemindersCommand; }); diff --git a/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php b/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php index 027a6532eaaf..1e1060793eba 100755 --- a/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php +++ b/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php @@ -31,7 +31,7 @@ public function register() */ protected function registerPasswordBroker() { - $this->app->bindShared('auth.password', function($app) + $this->app->singleton('auth.password', function($app) { // The password token repository is responsible for storing the email addresses // and password reset tokens. It will be used to verify the tokens are valid @@ -58,7 +58,7 @@ protected function registerPasswordBroker() */ protected function registerTokenRepository() { - $this->app->bindShared('auth.password.tokens', function($app) + $this->app->singleton('auth.password.tokens', function($app) { $connection = $app['db']->connection(); diff --git a/src/Illuminate/Cache/CacheServiceProvider.php b/src/Illuminate/Cache/CacheServiceProvider.php index 4dee84802252..c08602768406 100755 --- a/src/Illuminate/Cache/CacheServiceProvider.php +++ b/src/Illuminate/Cache/CacheServiceProvider.php @@ -18,17 +18,17 @@ class CacheServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('cache', function($app) + $this->app->singleton('cache', function($app) { return new CacheManager($app); }); - $this->app->bindShared('cache.store', function($app) + $this->app->singleton('cache.store', function($app) { return $app['cache']->driver(); }); - $this->app->bindShared('memcached.connector', function() + $this->app->singleton('memcached.connector', function() { return new MemcachedConnector; }); @@ -43,12 +43,12 @@ public function register() */ public function registerCommands() { - $this->app->bindShared('command.cache.clear', function($app) + $this->app->singleton('command.cache.clear', function($app) { return new Console\ClearCommand($app['cache'], $app['files']); }); - $this->app->bindShared('command.cache.table', function($app) + $this->app->singleton('command.cache.table', function($app) { return new Console\CacheTableCommand($app['files']); }); diff --git a/src/Illuminate/Cookie/CookieServiceProvider.php b/src/Illuminate/Cookie/CookieServiceProvider.php index 1c7b9d055536..f463302e6c94 100755 --- a/src/Illuminate/Cookie/CookieServiceProvider.php +++ b/src/Illuminate/Cookie/CookieServiceProvider.php @@ -11,7 +11,7 @@ class CookieServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('cookie', function($app) + $this->app->singleton('cookie', function($app) { $config = $app['config']['session']; diff --git a/src/Illuminate/Database/DatabaseServiceProvider.php b/src/Illuminate/Database/DatabaseServiceProvider.php index f6a127393269..a4b6eee22f0c 100755 --- a/src/Illuminate/Database/DatabaseServiceProvider.php +++ b/src/Illuminate/Database/DatabaseServiceProvider.php @@ -30,7 +30,7 @@ public function register() // The connection factory is used to create the actual connection instances on // the database. We will inject the factory into the manager so that it may // make the connections while they are actually needed and not of before. - $this->app->bindShared('db.factory', function($app) + $this->app->singleton('db.factory', function($app) { return new ConnectionFactory($app); }); @@ -38,7 +38,7 @@ public function register() // The database manager is used to resolve various connections, since multiple // connections might be managed. It also implements the connection resolver // interface which may be used by other components requiring connections. - $this->app->bindShared('db', function($app) + $this->app->singleton('db', function($app) { return new DatabaseManager($app, $app['db.factory']); }); @@ -51,7 +51,7 @@ public function register() */ protected function registerQueueableEntityResolver() { - $this->app->bindShared('Illuminate\Contracts\Queue\EntityResolver', function() + $this->app->singleton('Illuminate\Contracts\Queue\EntityResolver', function() { return new Eloquent\QueueEntityResolver; }); diff --git a/src/Illuminate/Database/MigrationServiceProvider.php b/src/Illuminate/Database/MigrationServiceProvider.php index 4328fa0f0ccd..962452dd0c0b 100755 --- a/src/Illuminate/Database/MigrationServiceProvider.php +++ b/src/Illuminate/Database/MigrationServiceProvider.php @@ -45,7 +45,7 @@ public function register() */ protected function registerRepository() { - $this->app->bindShared('migration.repository', function($app) + $this->app->singleton('migration.repository', function($app) { $table = $app['config']['database.migrations']; @@ -63,7 +63,7 @@ protected function registerMigrator() // The migrator is responsible for actually running and rollback the migration // files in the application. We'll pass in our database connection resolver // so the migrator can resolve any of these connections when it needs to. - $this->app->bindShared('migrator', function($app) + $this->app->singleton('migrator', function($app) { $repository = $app['migration.repository']; @@ -106,7 +106,7 @@ protected function registerCommands() */ protected function registerMigrateCommand() { - $this->app->bindShared('command.migrate', function($app) + $this->app->singleton('command.migrate', function($app) { $packagePath = $app['path.base'].'/vendor'; @@ -121,7 +121,7 @@ protected function registerMigrateCommand() */ protected function registerRollbackCommand() { - $this->app->bindShared('command.migrate.rollback', function($app) + $this->app->singleton('command.migrate.rollback', function($app) { return new RollbackCommand($app['migrator']); }); @@ -134,7 +134,7 @@ protected function registerRollbackCommand() */ protected function registerResetCommand() { - $this->app->bindShared('command.migrate.reset', function($app) + $this->app->singleton('command.migrate.reset', function($app) { return new ResetCommand($app['migrator']); }); @@ -147,7 +147,7 @@ protected function registerResetCommand() */ protected function registerRefreshCommand() { - $this->app->bindShared('command.migrate.refresh', function() + $this->app->singleton('command.migrate.refresh', function() { return new RefreshCommand; }); @@ -155,7 +155,7 @@ protected function registerRefreshCommand() protected function registerStatusCommand() { - $this->app->bindShared('command.migrate.status', function($app) + $this->app->singleton('command.migrate.status', function($app) { return new StatusCommand($app['migrator']); }); @@ -168,7 +168,7 @@ protected function registerStatusCommand() */ protected function registerInstallCommand() { - $this->app->bindShared('command.migrate.install', function($app) + $this->app->singleton('command.migrate.install', function($app) { return new InstallCommand($app['migration.repository']); }); @@ -183,7 +183,7 @@ protected function registerMakeCommand() { $this->registerCreator(); - $this->app->bindShared('command.migrate.make', function($app) + $this->app->singleton('command.migrate.make', function($app) { // Once we have the migration creator registered, we will create the command // and inject the creator. The creator is responsible for the actual file @@ -203,7 +203,7 @@ protected function registerMakeCommand() */ protected function registerCreator() { - $this->app->bindShared('migration.creator', function($app) + $this->app->singleton('migration.creator', function($app) { return new MigrationCreator($app['files']); }); diff --git a/src/Illuminate/Database/SeedServiceProvider.php b/src/Illuminate/Database/SeedServiceProvider.php index 7b5e6d44c846..3dd93c17728d 100755 --- a/src/Illuminate/Database/SeedServiceProvider.php +++ b/src/Illuminate/Database/SeedServiceProvider.php @@ -21,7 +21,7 @@ public function register() { $this->registerSeedCommand(); - $this->app->bindShared('seeder', function() + $this->app->singleton('seeder', function() { return new Seeder; }); @@ -36,7 +36,7 @@ public function register() */ protected function registerSeedCommand() { - $this->app->bindShared('command.seed', function($app) + $this->app->singleton('command.seed', function($app) { return new SeedCommand($app['db']); }); diff --git a/src/Illuminate/Encryption/EncryptionServiceProvider.php b/src/Illuminate/Encryption/EncryptionServiceProvider.php index e7e9421aac0a..9e9f0059a70a 100755 --- a/src/Illuminate/Encryption/EncryptionServiceProvider.php +++ b/src/Illuminate/Encryption/EncryptionServiceProvider.php @@ -11,7 +11,7 @@ class EncryptionServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('encrypter', function($app) + $this->app->singleton('encrypter', function($app) { $encrypter = new Encrypter($app['config']['app.key']); diff --git a/src/Illuminate/Filesystem/FilesystemServiceProvider.php b/src/Illuminate/Filesystem/FilesystemServiceProvider.php index 5082f2bee054..c2170b07aaf0 100755 --- a/src/Illuminate/Filesystem/FilesystemServiceProvider.php +++ b/src/Illuminate/Filesystem/FilesystemServiceProvider.php @@ -23,7 +23,7 @@ public function register() */ protected function registerNativeFilesystem() { - $this->app->bindShared('files', function() { return new Filesystem; }); + $this->app->singleton('files', function() { return new Filesystem; }); } /** @@ -35,12 +35,12 @@ protected function registerFlysystem() { $this->registerManager(); - $this->app->bindShared('filesystem.disk', function() + $this->app->singleton('filesystem.disk', function() { return $this->app['filesystem']->disk($this->getDefaultDriver()); }); - $this->app->bindShared('filesystem.cloud', function() + $this->app->singleton('filesystem.cloud', function() { return $this->app['filesystem']->disk($this->getCloudDriver()); }); @@ -53,7 +53,7 @@ protected function registerFlysystem() */ protected function registerManager() { - $this->app->bindShared('filesystem', function() + $this->app->singleton('filesystem', function() { return new FilesystemManager($this->app); }); diff --git a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php index b04b4a40e266..d3b1eeb01b63 100755 --- a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php +++ b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php @@ -79,7 +79,7 @@ public function register() */ protected function registerAppNameCommand() { - $this->app->bindShared('command.app.name', function($app) + $this->app->singleton('command.app.name', function($app) { return new AppNameCommand($app['composer'], $app['files']); }); @@ -92,7 +92,7 @@ protected function registerAppNameCommand() */ protected function registerChangesCommand() { - $this->app->bindShared('command.changes', function() + $this->app->singleton('command.changes', function() { return new ChangesCommand; }); @@ -105,7 +105,7 @@ protected function registerChangesCommand() */ protected function registerClearCompiledCommand() { - $this->app->bindShared('command.clear-compiled', function() + $this->app->singleton('command.clear-compiled', function() { return new ClearCompiledCommand; }); @@ -118,7 +118,7 @@ protected function registerClearCompiledCommand() */ protected function registerConsoleMakeCommand() { - $this->app->bindShared('command.console.make', function($app) + $this->app->singleton('command.console.make', function($app) { return new ConsoleMakeCommand($app['files']); }); @@ -131,7 +131,7 @@ protected function registerConsoleMakeCommand() */ protected function registerDownCommand() { - $this->app->bindShared('command.down', function() + $this->app->singleton('command.down', function() { return new DownCommand; }); @@ -144,7 +144,7 @@ protected function registerDownCommand() */ protected function registerEnvironmentCommand() { - $this->app->bindShared('command.environment', function() + $this->app->singleton('command.environment', function() { return new EnvironmentCommand; }); @@ -157,7 +157,7 @@ protected function registerEnvironmentCommand() */ protected function registerEventScanCommand() { - $this->app->bindShared('command.event.scan', function() + $this->app->singleton('command.event.scan', function() { return new EventScanCommand; }); @@ -170,7 +170,7 @@ protected function registerEventScanCommand() */ protected function registerKeyGenerateCommand() { - $this->app->bindShared('command.key.generate', function($app) + $this->app->singleton('command.key.generate', function($app) { return new KeyGenerateCommand($app['files']); }); @@ -183,7 +183,7 @@ protected function registerKeyGenerateCommand() */ protected function registerOptimizeCommand() { - $this->app->bindShared('command.optimize', function($app) + $this->app->singleton('command.optimize', function($app) { return new OptimizeCommand($app['composer']); }); @@ -196,7 +196,7 @@ protected function registerOptimizeCommand() */ protected function registerProviderMakeCommand() { - $this->app->bindShared('command.provider.make', function($app) + $this->app->singleton('command.provider.make', function($app) { return new ProviderMakeCommand($app['files']); }); @@ -209,7 +209,7 @@ protected function registerProviderMakeCommand() */ protected function registerRequestMakeCommand() { - $this->app->bindShared('command.request.make', function($app) + $this->app->singleton('command.request.make', function($app) { return new RequestMakeCommand($app['files']); }); @@ -222,7 +222,7 @@ protected function registerRequestMakeCommand() */ protected function registerRouteCacheCommand() { - $this->app->bindShared('command.route.cache', function($app) + $this->app->singleton('command.route.cache', function($app) { return new RouteCacheCommand($app['files']); }); @@ -235,7 +235,7 @@ protected function registerRouteCacheCommand() */ protected function registerRouteClearCommand() { - $this->app->bindShared('command.route.clear', function($app) + $this->app->singleton('command.route.clear', function($app) { return new RouteClearCommand($app['files']); }); @@ -248,7 +248,7 @@ protected function registerRouteClearCommand() */ protected function registerRouteListCommand() { - $this->app->bindShared('command.route.list', function($app) + $this->app->singleton('command.route.list', function($app) { return new RouteListCommand($app['router']); }); @@ -261,7 +261,7 @@ protected function registerRouteListCommand() */ protected function registerRouteScanCommand() { - $this->app->bindShared('command.route.scan', function() + $this->app->singleton('command.route.scan', function() { return new RouteScanCommand; }); @@ -274,7 +274,7 @@ protected function registerRouteScanCommand() */ protected function registerServeCommand() { - $this->app->bindShared('command.serve', function() + $this->app->singleton('command.serve', function() { return new ServeCommand; }); @@ -287,7 +287,7 @@ protected function registerServeCommand() */ protected function registerTinkerCommand() { - $this->app->bindShared('command.tinker', function() + $this->app->singleton('command.tinker', function() { return new TinkerCommand; }); @@ -300,7 +300,7 @@ protected function registerTinkerCommand() */ protected function registerUpCommand() { - $this->app->bindShared('command.up', function() + $this->app->singleton('command.up', function() { return new UpCommand; }); diff --git a/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php b/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php index 570e22d4cf5f..577dfaf6c06f 100755 --- a/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php +++ b/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php @@ -20,12 +20,12 @@ class ComposerServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('composer', function($app) + $this->app->singleton('composer', function($app) { return new Composer($app['files'], $app['path.base']); }); - $this->app->bindShared('command.dump-autoload', function($app) + $this->app->singleton('command.dump-autoload', function($app) { return new AutoloadCommand($app['composer']); }); diff --git a/src/Illuminate/Foundation/Providers/PublisherServiceProvider.php b/src/Illuminate/Foundation/Providers/PublisherServiceProvider.php index c30d5a804617..92f4e145d33a 100755 --- a/src/Illuminate/Foundation/Providers/PublisherServiceProvider.php +++ b/src/Illuminate/Foundation/Providers/PublisherServiceProvider.php @@ -49,7 +49,7 @@ protected function registerAssetPublisher() { $this->registerAssetPublishCommand(); - $this->app->bindShared('asset.publisher', function($app) + $this->app->singleton('asset.publisher', function($app) { $publicPath = $app['path.public']; @@ -71,7 +71,7 @@ protected function registerAssetPublisher() */ protected function registerAssetPublishCommand() { - $this->app->bindShared('command.asset.publish', function($app) + $this->app->singleton('command.asset.publish', function($app) { return new AssetPublishCommand($app['asset.publisher']); }); @@ -86,7 +86,7 @@ protected function registerConfigPublisher() { $this->registerConfigPublishCommand(); - $this->app->bindShared('config.publisher', function($app) + $this->app->singleton('config.publisher', function($app) { $path = $app['path.config']; @@ -108,7 +108,7 @@ protected function registerConfigPublisher() */ protected function registerConfigPublishCommand() { - $this->app->bindShared('command.config.publish', function($app) + $this->app->singleton('command.config.publish', function($app) { return new ConfigPublishCommand($app['config.publisher']); }); @@ -123,7 +123,7 @@ protected function registerViewPublisher() { $this->registerViewPublishCommand(); - $this->app->bindShared('view.publisher', function($app) + $this->app->singleton('view.publisher', function($app) { $viewPath = $app['path.base'].'/resources/views'; @@ -145,7 +145,7 @@ protected function registerViewPublisher() */ protected function registerViewPublishCommand() { - $this->app->bindShared('command.view.publish', function($app) + $this->app->singleton('command.view.publish', function($app) { return new ViewPublishCommand($app['view.publisher']); }); @@ -160,7 +160,7 @@ protected function registerMigrationPublisher() { $this->registerMigratePublishCommand(); - $this->app->bindShared('migration.publisher', function($app) + $this->app->singleton('migration.publisher', function($app) { return new MigrationPublisher($app['files']); }); @@ -173,7 +173,7 @@ protected function registerMigrationPublisher() */ protected function registerMigratePublishCommand() { - $this->app->bindShared('command.migrate.publish', function() + $this->app->singleton('command.migrate.publish', function() { return new MigratePublishCommand; }); diff --git a/src/Illuminate/Hashing/HashServiceProvider.php b/src/Illuminate/Hashing/HashServiceProvider.php index cc1f5c282869..0ce1e83a2f61 100755 --- a/src/Illuminate/Hashing/HashServiceProvider.php +++ b/src/Illuminate/Hashing/HashServiceProvider.php @@ -18,7 +18,7 @@ class HashServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('hash', function() { return new BcryptHasher; }); + $this->app->singleton('hash', function() { return new BcryptHasher; }); } /** diff --git a/src/Illuminate/Mail/MailServiceProvider.php b/src/Illuminate/Mail/MailServiceProvider.php index 8d149fd08189..2f32c1a5e680 100755 --- a/src/Illuminate/Mail/MailServiceProvider.php +++ b/src/Illuminate/Mail/MailServiceProvider.php @@ -19,7 +19,7 @@ class MailServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('mailer', function($app) + $this->app->singleton('mailer', function($app) { $this->registerSwiftMailer(); diff --git a/src/Illuminate/Queue/FailConsoleServiceProvider.php b/src/Illuminate/Queue/FailConsoleServiceProvider.php index 655187749845..32da987dcbee 100644 --- a/src/Illuminate/Queue/FailConsoleServiceProvider.php +++ b/src/Illuminate/Queue/FailConsoleServiceProvider.php @@ -23,27 +23,27 @@ class FailConsoleServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('command.queue.failed', function() + $this->app->singleton('command.queue.failed', function() { return new ListFailedCommand; }); - $this->app->bindShared('command.queue.retry', function() + $this->app->singleton('command.queue.retry', function() { return new RetryCommand; }); - $this->app->bindShared('command.queue.forget', function() + $this->app->singleton('command.queue.forget', function() { return new ForgetFailedCommand; }); - $this->app->bindShared('command.queue.flush', function() + $this->app->singleton('command.queue.flush', function() { return new FlushFailedCommand; }); - $this->app->bindShared('command.queue.failed-table', function($app) + $this->app->singleton('command.queue.failed-table', function($app) { return new FailedTableCommand($app['files']); }); diff --git a/src/Illuminate/Queue/QueueServiceProvider.php b/src/Illuminate/Queue/QueueServiceProvider.php index 8e3ceaf0b1be..c2e2cc2eb9d8 100755 --- a/src/Illuminate/Queue/QueueServiceProvider.php +++ b/src/Illuminate/Queue/QueueServiceProvider.php @@ -49,7 +49,7 @@ public function register() */ protected function registerManager() { - $this->app->bindShared('queue', function($app) + $this->app->singleton('queue', function($app) { // Once we have an instance of the queue manager, we will register the various // resolvers for the queue connectors. These connectors are responsible for @@ -61,7 +61,7 @@ protected function registerManager() return $manager; }); - $this->app->bindShared('queue.connection', function($app) + $this->app->singleton('queue.connection', function($app) { return $app['queue']->connection(); }); @@ -78,7 +78,7 @@ protected function registerWorker() $this->registerRestartCommand(); - $this->app->bindShared('queue.worker', function($app) + $this->app->singleton('queue.worker', function($app) { return new Worker($app['queue'], $app['queue.failer'], $app['events']); }); @@ -91,7 +91,7 @@ protected function registerWorker() */ protected function registerWorkCommand() { - $this->app->bindShared('command.queue.work', function($app) + $this->app->singleton('command.queue.work', function($app) { return new WorkCommand($app['queue.worker']); }); @@ -108,7 +108,7 @@ protected function registerListener() { $this->registerListenCommand(); - $this->app->bindShared('queue.listener', function($app) + $this->app->singleton('queue.listener', function($app) { return new Listener($app['path.base']); }); @@ -121,7 +121,7 @@ protected function registerListener() */ protected function registerListenCommand() { - $this->app->bindShared('command.queue.listen', function($app) + $this->app->singleton('command.queue.listen', function($app) { return new ListenCommand($app['queue.listener']); }); @@ -136,7 +136,7 @@ protected function registerListenCommand() */ public function registerRestartCommand() { - $this->app->bindShared('command.queue.restart', function() + $this->app->singleton('command.queue.restart', function() { return new RestartCommand; }); @@ -151,7 +151,7 @@ public function registerRestartCommand() */ protected function registerSubscriber() { - $this->app->bindShared('command.queue.subscribe', function() + $this->app->singleton('command.queue.subscribe', function() { return new SubscribeCommand; }); @@ -272,7 +272,7 @@ protected function registerIronRequestBinder() */ protected function registerFailedJobServices() { - $this->app->bindShared('queue.failer', function($app) + $this->app->singleton('queue.failer', function($app) { $config = $app['config']['queue.failed']; @@ -287,7 +287,7 @@ protected function registerFailedJobServices() */ protected function registerQueueClosure() { - $this->app->bindShared('IlluminateQueueClosure', function($app) + $this->app->singleton('IlluminateQueueClosure', function($app) { return new IlluminateQueueClosure($app['encrypter']); }); diff --git a/src/Illuminate/Redis/RedisServiceProvider.php b/src/Illuminate/Redis/RedisServiceProvider.php index 947d365d9168..fdd653dd300d 100755 --- a/src/Illuminate/Redis/RedisServiceProvider.php +++ b/src/Illuminate/Redis/RedisServiceProvider.php @@ -18,7 +18,7 @@ class RedisServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('redis', function($app) + $this->app->singleton('redis', function($app) { return new Database($app['config']['database.redis']); }); diff --git a/src/Illuminate/Routing/GeneratorServiceProvider.php b/src/Illuminate/Routing/GeneratorServiceProvider.php index 51c8556a8bd4..f3edcd4131fe 100644 --- a/src/Illuminate/Routing/GeneratorServiceProvider.php +++ b/src/Illuminate/Routing/GeneratorServiceProvider.php @@ -34,7 +34,7 @@ public function register() */ protected function registerControllerGenerator() { - $this->app->bindShared('command.controller.make', function($app) + $this->app->singleton('command.controller.make', function($app) { return new ControllerMakeCommand($app['files']); }); @@ -47,7 +47,7 @@ protected function registerControllerGenerator() */ protected function registerMiddlewareGenerator() { - $this->app->bindShared('command.middleware.make', function($app) + $this->app->singleton('command.middleware.make', function($app) { return new MiddlewareMakeCommand($app['files']); }); diff --git a/src/Illuminate/Routing/RoutingServiceProvider.php b/src/Illuminate/Routing/RoutingServiceProvider.php index 97456da844b6..88dff7d3dc2e 100755 --- a/src/Illuminate/Routing/RoutingServiceProvider.php +++ b/src/Illuminate/Routing/RoutingServiceProvider.php @@ -110,7 +110,7 @@ protected function registerRedirector() */ protected function registerResponseFactory() { - $this->app->bindShared('Illuminate\Contracts\Routing\ResponseFactory', function($app) + $this->app->singleton('Illuminate\Contracts\Routing\ResponseFactory', function($app) { return new ResponseFactory($app['Illuminate\Contracts\View\Factory'], $app['redirect']); }); diff --git a/src/Illuminate/Session/CommandsServiceProvider.php b/src/Illuminate/Session/CommandsServiceProvider.php index bafed8dd1af9..c48d375841f7 100755 --- a/src/Illuminate/Session/CommandsServiceProvider.php +++ b/src/Illuminate/Session/CommandsServiceProvider.php @@ -18,7 +18,7 @@ class CommandsServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('command.session.database', function($app) + $this->app->singleton('command.session.database', function($app) { return new Console\SessionTableCommand($app['files']); }); diff --git a/src/Illuminate/Session/SessionServiceProvider.php b/src/Illuminate/Session/SessionServiceProvider.php index 0efe172de502..70fd15213dac 100755 --- a/src/Illuminate/Session/SessionServiceProvider.php +++ b/src/Illuminate/Session/SessionServiceProvider.php @@ -38,7 +38,7 @@ protected function setupDefaultDriver() */ protected function registerSessionManager() { - $this->app->bindShared('session', function($app) + $this->app->singleton('session', function($app) { return new SessionManager($app); }); @@ -51,7 +51,7 @@ protected function registerSessionManager() */ protected function registerSessionDriver() { - $this->app->bindShared('session.store', function($app) + $this->app->singleton('session.store', function($app) { // First, we will create the session manager which is responsible for the // creation of the various session drivers when they are needed by the diff --git a/src/Illuminate/Translation/TranslationServiceProvider.php b/src/Illuminate/Translation/TranslationServiceProvider.php index f8ce9904c1fe..efb4e45e9ca2 100755 --- a/src/Illuminate/Translation/TranslationServiceProvider.php +++ b/src/Illuminate/Translation/TranslationServiceProvider.php @@ -20,7 +20,7 @@ public function register() { $this->registerLoader(); - $this->app->bindShared('translator', function($app) + $this->app->singleton('translator', function($app) { $loader = $app['translation.loader']; @@ -44,7 +44,7 @@ public function register() */ protected function registerLoader() { - $this->app->bindShared('translation.loader', function($app) + $this->app->singleton('translation.loader', function($app) { return new FileLoader($app['files'], $app['path.lang']); }); diff --git a/src/Illuminate/Validation/ValidationServiceProvider.php b/src/Illuminate/Validation/ValidationServiceProvider.php index 09f5bd8a011f..95754a2e8040 100755 --- a/src/Illuminate/Validation/ValidationServiceProvider.php +++ b/src/Illuminate/Validation/ValidationServiceProvider.php @@ -42,7 +42,7 @@ protected function registerValiationResolverHook() */ protected function registerValidationFactory() { - $this->app->bindShared('validator', function($app) + $this->app->singleton('validator', function($app) { $validator = new Factory($app['translator'], $app); @@ -65,7 +65,7 @@ protected function registerValidationFactory() */ protected function registerPresenceVerifier() { - $this->app->bindShared('validation.presence', function($app) + $this->app->singleton('validation.presence', function($app) { return new DatabasePresenceVerifier($app['db']); }); diff --git a/src/Illuminate/View/ViewServiceProvider.php b/src/Illuminate/View/ViewServiceProvider.php index 0e292ea91b1f..936601b95c89 100755 --- a/src/Illuminate/View/ViewServiceProvider.php +++ b/src/Illuminate/View/ViewServiceProvider.php @@ -30,7 +30,7 @@ public function register() */ public function registerEngineResolver() { - $this->app->bindShared('view.engine.resolver', function() + $this->app->singleton('view.engine.resolver', function() { $resolver = new EngineResolver; @@ -70,7 +70,7 @@ public function registerBladeEngine($resolver) // The Compiler engine requires an instance of the CompilerInterface, which in // this case will be the Blade compiler, so we'll first create the compiler // instance to pass into the engine so it can compile the views properly. - $app->bindShared('blade.compiler', function($app) + $app->singleton('blade.compiler', function($app) { $cache = $app['config']['view.compiled']; @@ -90,7 +90,7 @@ public function registerBladeEngine($resolver) */ public function registerViewFinder() { - $this->app->bindShared('view.finder', function($app) + $this->app->singleton('view.finder', function($app) { $paths = $app['config']['view.paths']; @@ -105,7 +105,7 @@ public function registerViewFinder() */ public function registerFactory() { - $this->app->bindShared('view', function($app) + $this->app->singleton('view', function($app) { // Next we need to grab the engine resolver instance that will be used by the // environment. The resolver will be used by an environment to get each of diff --git a/src/Illuminate/Workbench/WorkbenchServiceProvider.php b/src/Illuminate/Workbench/WorkbenchServiceProvider.php index f0b0d36383a3..808356722d43 100755 --- a/src/Illuminate/Workbench/WorkbenchServiceProvider.php +++ b/src/Illuminate/Workbench/WorkbenchServiceProvider.php @@ -19,12 +19,12 @@ class WorkbenchServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bindShared('package.creator', function($app) + $this->app->singleton('package.creator', function($app) { return new PackageCreator($app['files']); }); - $this->app->bindShared('command.workbench', function($app) + $this->app->singleton('command.workbench', function($app) { return new WorkbenchMakeCommand($app['package.creator']); }); diff --git a/tests/Foundation/FoundationApplicationTest.php b/tests/Foundation/FoundationApplicationTest.php index 6062fa26c20d..ac207c1d6619 100755 --- a/tests/Foundation/FoundationApplicationTest.php +++ b/tests/Foundation/FoundationApplicationTest.php @@ -147,7 +147,7 @@ class ApplicationDeferredSharedServiceProviderStub extends Illuminate\Support\Se protected $defer = true; public function register() { - $this->app->bindShared('foo', function() { + $this->app->singleton('foo', function() { return new StdClass; }); } @@ -188,7 +188,7 @@ class ApplicationMultiProviderStub extends Illuminate\Support\ServiceProvider { protected $defer = true; public function register() { - $this->app->bindShared('foo', function() { return 'foo'; }); - $this->app->bindShared('bar', function($app) { return $app['foo'].'bar'; }); + $this->app->singleton('foo', function() { return 'foo'; }); + $this->app->singleton('bar', function($app) { return $app['foo'].'bar'; }); } } From db5d61766f26fb1be95b6aca5a3e3409814dd9b6 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 4 Nov 2014 01:07:23 +0100 Subject: [PATCH 20/25] Clean up middleware. --- src/Illuminate/Cookie/Middleware/AddQueuedCookiesToRequest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToRequest.php b/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToRequest.php index 7718fbf6d53c..55a384b35451 100644 --- a/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToRequest.php +++ b/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToRequest.php @@ -2,7 +2,6 @@ use Closure; use Illuminate\Contracts\Routing\Middleware; -use Symfony\Component\HttpFoundation\Request; use Illuminate\Contracts\Cookie\QueueingFactory as CookieJar; class AddQueuedCookiesToRequest implements Middleware { @@ -37,7 +36,9 @@ public function handle($request, Closure $next) $response = $next($request); foreach ($this->cookies->getQueuedCookies() as $cookie) + { $response->headers->setCookie($cookie); + } return $response; } From e86ada0d62d92fe8cc6df6b7d08b92bdfaeec1e5 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 4 Nov 2014 02:22:54 +0100 Subject: [PATCH 21/25] Add failing test for mass composer registration. --- tests/View/ViewFactoryTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/View/ViewFactoryTest.php b/tests/View/ViewFactoryTest.php index baa86efb6581..cbd9c01deac3 100755 --- a/tests/View/ViewFactoryTest.php +++ b/tests/View/ViewFactoryTest.php @@ -176,6 +176,7 @@ public function testComposersCanBeMassRegistered() 'baz@baz' => array('qux', 'foo'), )); + $this->assertCount(3, $composers); $reflections = array( new ReflectionFunction($composers[0]), new ReflectionFunction($composers[1]), From 7a0fd522fa17886867f6c3f8739c8bdb17e7e18d Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 4 Nov 2014 02:25:31 +0100 Subject: [PATCH 22/25] Fix merging of composers. --- src/Illuminate/View/Factory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/View/Factory.php b/src/Illuminate/View/Factory.php index 4d0fa8d2a507..ddca64c1bcb2 100755 --- a/src/Illuminate/View/Factory.php +++ b/src/Illuminate/View/Factory.php @@ -325,7 +325,7 @@ public function composers(array $composers) foreach ($composers as $callback => $views) { - $registered += $this->composer($views, $callback); + $registered = array_merge($registered, $this->composer($views, $callback)); } return $registered; From 1b9f905f45b984eac3e3307f4d3dfcbff54c4a2e Mon Sep 17 00:00:00 2001 From: Pavel Voronin Date: Tue, 4 Nov 2014 22:40:26 +0300 Subject: [PATCH 23/25] Intendation fix --- src/Illuminate/Foundation/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 2e5ba57d7de5..be3ec9c567cc 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -496,7 +496,7 @@ function view($view = null, $data = array(), $mergeData = array()) if ( ! function_exists('elixir')) { - /** + /** * Get the path to a versioned Elixir file. * * @param string $file From 9126769aab576aa7e6a705c831d19c2c73633028 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 4 Nov 2014 14:12:07 -0600 Subject: [PATCH 24/25] Respect debug mode. --- .../Foundation/Debug/ExceptionHandler.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Debug/ExceptionHandler.php b/src/Illuminate/Foundation/Debug/ExceptionHandler.php index 1f5464079941..83498f68e4bc 100644 --- a/src/Illuminate/Foundation/Debug/ExceptionHandler.php +++ b/src/Illuminate/Foundation/Debug/ExceptionHandler.php @@ -2,11 +2,19 @@ use Exception; use Psr\Log\LoggerInterface; +use Illuminate\Contracts\Config\Repository as Configuration; use Symfony\Component\Debug\ExceptionHandler as SymfonyDisplayer; use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandlerContract; class ExceptionHandler implements ExceptionHandlerContract { + /** + * The configuration repository implementation. + * + * @var \Illuminate\Contracts\Config\Repository + */ + protected $config; + /** * The log implementation. * @@ -17,12 +25,14 @@ class ExceptionHandler implements ExceptionHandlerContract { /** * Create a new exception handler instance. * + * @param \Illuminate\Contracts\Config\Repository $config * @param \Psr\Log\LoggerInterface $log * @return void */ - public function __construct(LoggerInterface $log) + public function __construct(Configuration $config, LoggerInterface $log) { $this->log = $log; + $this->config = $config; } /** @@ -45,7 +55,7 @@ public function report(Exception $e) */ public function render($request, Exception $e) { - return (new SymfonyDisplayer)->createResponse($e); + return (new SymfonyDisplayer($this->config->get('app.debug')))->createResponse($e); } /** From b6d1e7ecb0ad5375a7d8b0e99ce4ead16af8afc6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 5 Nov 2014 15:03:40 -0600 Subject: [PATCH 25/25] Compile more files. --- .../Foundation/Console/Optimize/config.php | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Foundation/Console/Optimize/config.php b/src/Illuminate/Foundation/Console/Optimize/config.php index 3864168aec6a..8cdc171897bd 100755 --- a/src/Illuminate/Foundation/Console/Optimize/config.php +++ b/src/Illuminate/Foundation/Console/Optimize/config.php @@ -18,6 +18,7 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Cookie/QueueingFactory.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Encryption/Encrypter.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/HttpKernel.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Routing/Registrar.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Routing/ResponseFactory.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Routing/UrlGenerator.php', @@ -32,6 +33,14 @@ $basePath.'/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Application.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/EnvironmentDetector.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Http/Request.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Http/FrameGuard.php', $basePath.'/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php', @@ -50,14 +59,19 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/AggregateServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Providers/EventServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/RouteServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Pagination/Paginator.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Traits/MacroableTrait.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Arr.php', @@ -87,7 +101,9 @@ $basePath.'/vendor/symfony/routing/Symfony/Component/Routing/Route.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/Controller.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/ControllerInspector.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/Stack.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/Matching/MethodValidator.php', @@ -100,18 +116,21 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Session/SessionInterface.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Session/Middleware/Reader.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Session/Middleware/Writer.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Session/Middleware/ReadSession.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Session/Middleware/WriteSession.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Session/Middleware/MiddlewareTrait.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Session/Store.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Manager.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Collection.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Cookie/CookieJar.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/Guard.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/Queue.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToRequest.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/Facades/Log.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Log/Writer.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php', $basePath.'/vendor/monolog/monolog/src/Monolog/Logger.php', $basePath.'/vendor/psr/log/Psr/Log/LoggerInterface.php', $basePath.'/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',