From 8683cba06557291428cdcea43ec05968a5fb5988 Mon Sep 17 00:00:00 2001 From: Gourab Nag Date: Sun, 3 Apr 2016 02:18:02 +0530 Subject: [PATCH] Fixed Typo in line 38 --- 07-inversion-of-control.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/07-inversion-of-control.md b/07-inversion-of-control.md index 8a1f5dd..5a13293 100644 --- a/07-inversion-of-control.md +++ b/07-inversion-of-control.md @@ -35,7 +35,7 @@ class Homepage Note that you are [importing](http://php.net/manual/en/language.namespaces.importing.php) `Http\Response` at the top of the file. This means that whenever you use `Response` inside this file, it will resolve to the fully qualified name. -In the contructor you are now explicitly asking for a `Http\Response`. In this case, `Http\Response` is an interface. So any class that implements the interface can be injected. See [type hinting](http://php.net/manual/en/language.oop5.typehinting.php) and [interfaces](http://php.net/manual/en/language.oop5.interfaces.php) for reference. +In the constructor you are now explicitly asking for a `Http\Response`. In this case, `Http\Response` is an interface. So any class that implements the interface can be injected. See [type hinting](http://php.net/manual/en/language.oop5.typehinting.php) and [interfaces](http://php.net/manual/en/language.oop5.interfaces.php) for reference. Now the code will result in an error because you are not actually injecting anything. So let's fix that in your `Bootstrap.php` where you dispatch when a route was found: @@ -48,4 +48,4 @@ The `Http\HttpResponse` object implements the `Http\Response` interface, so it f Now everything should work again. But if you follow this example, all your objects that are instantiated this way will have the same objects injected. This is of course not good, so let's fix that in the next part. -[<< previous](06-dispatching-to-a-class.md) | [next >>](08-dependency-injector.md) \ No newline at end of file +[<< previous](06-dispatching-to-a-class.md) | [next >>](08-dependency-injector.md)