From 262083d4ddb2a3517621b9911138e70b9e465e8c Mon Sep 17 00:00:00 2001 From: Ivan Vegner Date: Mon, 31 Jul 2017 13:57:25 +0300 Subject: [PATCH] Add info on tests to readme --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b933f25..222b7ec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ Registers services and injects them into consumers. +Installation +============ + +```bash +composer require ob-ivan/sd-dependency-injection +``` + +Usage +===== + Three types of dependency injection are supported: - **Setter injection** aka **Interface injection** - given an Instance implementing DeclarerInterface call a setter for each declared dependency. @@ -12,9 +22,9 @@ Three types of dependency injection are supported: You can use container to register services, or to produce consumers, or to inject dependencies into arbitrary code. - Consumer = Function | Instance - ConsumerInitializer = ClassName | Consumer - ServiceInitializer = ConsumerInitializer | Value +- Consumer = Function | Instance +- ConsumerInitializer = ClassName | Consumer +- ServiceInitializer = ConsumerInitializer | Value Container is initialized with raw values, no Initalizers allowed: @@ -77,3 +87,12 @@ you use the power of dependency injection: ```php $legacyConsumer = new LegacyConsumer($container->get('brand_new_service')); ``` + +Development +=========== +To run tests: + +```bash +composer install +vendor/bin/phpunit +```