From 8f7d95d86f223d38ce43fe635fda14509e3ebd66 Mon Sep 17 00:00:00 2001 From: lubiana Date: Mon, 2 May 2022 08:39:48 +0200 Subject: [PATCH] readability fixes in chapters 7 and 9 --- 07-dispatching-to-a-class.md | 4 ++-- 09-dependency-injector.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/07-dispatching-to-a-class.md b/07-dispatching-to-a-class.md index c3555ef..830a30f 100644 --- a/07-dispatching-to-a-class.md +++ b/07-dispatching-to-a-class.md @@ -12,7 +12,7 @@ So forget about MVC and instead let's worry about [separation of concerns](http: We will need a descriptive name for the classes that handle the requests. For this tutorial I will use `Handler`, other common names are 'Controllers' or 'Actions'. -Create a new folder inside the `src/` folder with the name `Handler`.In this folder we will place all our action classes. +Create a new folder inside the `src/` folder with the name `Action`. In this folder we will place all our action classes. In there, create a `Hello.php` file. ```php @@ -36,7 +36,7 @@ You can see that we implement the [RequestHandlerInterface](https://github.com/p that has a 'handle'-Method with requires a Requestobject as its parameter and returns a Responseobject. For now this is fine, but we may have to change our approach later. In anyway it is good to know about this interface as we will implement it in some other parts of our application as well. In order to use that Interface we have to require it with composer: -'composer require psr/http-server-handler'. +`composer require psr/http-server-handler`. The autoloader will only work if the namespace of a class matches the file path and the file name equals the class name. At the beginning I defined `Lubian\NoFramework` as the root namespace of the application so this is referring to the `src/` folder. diff --git a/09-dependency-injector.md b/09-dependency-injector.md index 7f7c6a2..cfbeb7a 100644 --- a/09-dependency-injector.md +++ b/09-dependency-injector.md @@ -12,7 +12,7 @@ for a [suitable solution on packagist](https://packagist.org/providers/psr/conta I choose the [PHP-DI](https://packagist.org/packages/php-di/php-di) container, as it is easy to configure and provides some very [powerfull features](https://php-di.org/#autowiring) out of the box. -After installing the container through composer create a new file with the name 'dependencies.php' in your config folder: +After installing the container through composer create a new file with the name `dependencies.php` in your config folder: ```php