From ad8aa333c96bd7ac3cb9721bd7920458d85de9c6 Mon Sep 17 00:00:00 2001 From: Nobuo Kihara Date: Tue, 29 Sep 2015 21:53:57 +0900 Subject: [PATCH 1/3] docs/guide/concept-di-container.md revised [ci skip] --- docs/guide/concept-di-container.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md index 57b35e18af..ee969809f0 100644 --- a/docs/guide/concept-di-container.md +++ b/docs/guide/concept-di-container.md @@ -15,6 +15,7 @@ dependency injection: * Constructor injection; * Setter and property injection; * PHP callable injection. +* Method signiture injection. ### Constructor Injection @@ -116,10 +117,12 @@ $foo = $container->get('Foo'); By doing so, the person who wants to configure the `Foo` class no longer needs to be aware of how it is built. -### Controller action injection +### Method signature injection -Controller action injection is a special type of DI where dependecies are resolved per action which is useful for -keeping dependencies number low in MVC controllers. +Method signature injection is a special type of DI where dependecies are declared using the type hints of +method signatures and resolved in the runtime when the method is acturally called. It is particularly useful for keeping +the MVC controllers slim and light-weighted since it doesn't require you to configure all the possible dependencies +of the controller beforehand. ```php public function actionSend($email, EmailValidator $validator) From 261b987bef06bfca2f72814a3da73162be301c71 Mon Sep 17 00:00:00 2001 From: Nobuo Kihara Date: Tue, 29 Sep 2015 21:58:11 +0900 Subject: [PATCH 2/3] typo [ci skip] --- docs/guide/concept-di-container.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md index ee969809f0..001b25cffa 100644 --- a/docs/guide/concept-di-container.md +++ b/docs/guide/concept-di-container.md @@ -120,7 +120,7 @@ By doing so, the person who wants to configure the `Foo` class no longer needs t ### Method signature injection Method signature injection is a special type of DI where dependecies are declared using the type hints of -method signatures and resolved in the runtime when the method is acturally called. It is particularly useful for keeping +method signature and resolved in the runtime when the method is acturally called. It is particularly useful for keeping the MVC controllers slim and light-weighted since it doesn't require you to configure all the possible dependencies of the controller beforehand. From e1112a239511ce73a412e1116acdf1db45a6c4ee Mon Sep 17 00:00:00 2001 From: Nobuo Kihara Date: Wed, 30 Sep 2015 06:07:14 +0900 Subject: [PATCH 3/3] reverted to "controller action injection" [ci skip] --- docs/guide/concept-di-container.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md index 001b25cffa..bcb32b52c1 100644 --- a/docs/guide/concept-di-container.md +++ b/docs/guide/concept-di-container.md @@ -15,7 +15,7 @@ dependency injection: * Constructor injection; * Setter and property injection; * PHP callable injection. -* Method signiture injection. +* Controller action injection. ### Constructor Injection @@ -117,10 +117,10 @@ $foo = $container->get('Foo'); By doing so, the person who wants to configure the `Foo` class no longer needs to be aware of how it is built. -### Method signature injection +### Controller action injection -Method signature injection is a special type of DI where dependecies are declared using the type hints of -method signature and resolved in the runtime when the method is acturally called. It is particularly useful for keeping +Controller action injection is a special type of DI where dependecies are declared using the type hints of +method signature and resolved in the runtime when the action is acturally called. It is useful for keeping the MVC controllers slim and light-weighted since it doesn't require you to configure all the possible dependencies of the controller beforehand.