diff --git a/README.md b/README.md new file mode 100644 index 0000000..6ceabc6 --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +# minphp/Container + +[![Build Status](https://travis-ci.org/phillipsdata/minphp-container.svg?branch=1.0.0)](https://travis-ci.org/phillipsdata/minphp-container) + +A [standards compliant](https://github.com/container-interop/container-interop/) [Pimple](https://github.com/silexphp/Pimple)-based container. + +## Installation + +Install via composer: + +```sh +composer install minphp/container:~1.0 +``` + +## Basic Usage + +```php +set('queue', function($c) { + return new \SplQueue(); +}); + +// Verify +$queue_exists = $container->has('queue'); + +// Fetch +$queue = $container->get('queue'); + +// Remove +$container->remove('queue'); + +``` + +You can also use the container as an array, as per Pimple. Though, using the **ContainerInterface** defined methods is preferable as it eases switching to a different container ifyou ever need to. + +```php +container = $container; + } + + public function getContainer() + { + return $this->container; + } +} + +```