Skip to content

Commit 86d0bcb

Browse files
committed
Provide README
1 parent 8ec7617 commit 86d0bcb

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

README.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,48 @@
1-
# array-container
2-
Plain-simple array container implementation for PSR-11
1+
![Status](https://github.com/technically-php/array-container/actions/workflows/test.yml/badge.svg)
2+
3+
# ArrayContainer
4+
5+
`ArrayContainer` is a plain-simple [PSR-11](https://www.php-fig.org/psr/psr-11/) container implementation
6+
powered by a simple associative array under the hood.
7+
8+
## Features
9+
10+
- PSR-11
11+
- PHP 7.1+
12+
- PHP 8.0
13+
- Semver
14+
- Tests
15+
16+
## Installation
17+
18+
Use [Composer](https://getcomposer.org/) package manager to add *ArrayContainer* to your project:
19+
20+
```
21+
composer require technically/array-container
22+
```
23+
24+
## Example
25+
26+
```php
27+
<?php
28+
29+
use Technically\ArrayContainer\ArrayContainer;
30+
31+
// ... instantiate your services: $logger, $cache, $config
32+
33+
// Instantiate with predefined entries
34+
$container = new ArrayContainer([
35+
'logger' => $logger,
36+
'cache' => $cache,
37+
]);
38+
39+
// Add more entries later
40+
$container->set('config', $config);
41+
42+
// Get entries from it later in your code
43+
$logger = $container->get('logger');
44+
```
45+
46+
## Credits
47+
48+
- Implemented by [Ivan Voskoboinyk](https://github.com/e1himself)

0 commit comments

Comments
 (0)