Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elazar/auryn-configuration
Modularized configurations for the Auryn dependency injector
https://github.com/elazar/auryn-configuration
Last synced: 2 months ago
JSON representation
Modularized configurations for the Auryn dependency injector
- Host: GitHub
- URL: https://github.com/elazar/auryn-configuration
- Owner: elazar
- License: mit
- Created: 2016-06-26T00:42:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-26T00:49:09.000Z (over 8 years ago)
- Last Synced: 2024-10-03T10:48:39.936Z (3 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elazar/auryn-configuration
[![Build Status](https://travis-ci.org/elazar/auryn-configuration.svg?branch=master)](https://travis-ci.org/elazar/auryn-configuration)
Modularized configurations for the [Auryn](https://github.com/rdlowrey/Auryn) dependency injector
## License
This library is licensed under the [MIT License](https://opensource.org/licenses/MIT).
## Installation
Use [composer](https://getcomposer.org/).
```
composer require elazar/auryn-configuration
```## Usage
Individual configurations are defined like so:
```php
use Auryn\Injector;
use Elazar\Auryn\Configuration\ConfigurationInterface;class FooConfiguration implements ConfigurationInterface
{
public function __invoke(Injector $injector)
{
// ...
}
}
```These configurations can be grouped into reusable sets like so:
```php
use Elazar\Auryn\Configuration\ConfigurationSet;class AcmeConfigurationSet extends ConfigurationSet
{
public function __construct()
{
parent::__construct([
FooConfiguration::class,
BarConfiguration::class,
// ...
]);
}
}
```Individual configurations and configuration sets are applied to injectors in the same way:
```php
$injector = new Injector;$configuration = $injector->make(FooConfiguration::class);
$configuration($injector);$set = $injector->make(AcmeConfigurationSet::clss);
$set($injector);
```## Development
To run the PHPUnit test suite:
```
composer run-script test
```