File tree Expand file tree Collapse file tree 1 file changed +48
-2
lines changed Expand file tree Collapse file tree 1 file changed +48
-2
lines changed Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments