Skip to content

Commit

Permalink
Add info on tests to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Vegner committed Jul 31, 2017
1 parent d6ebe9e commit 262083d
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:

Expand Down Expand Up @@ -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
```

0 comments on commit 262083d

Please sign in to comment.