PHP code example of elazar / auryn-configuration

1. Go to this page and download the library: Download elazar/auryn-configuration library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elazar / auryn-configuration example snippets


use Auryn\Injector;
use Elazar\Auryn\Configuration\ConfigurationInterface;

class FooConfiguration implements ConfigurationInterface
{
    public function __invoke(Injector $injector)
    {
        // ...
    }
}

use Elazar\Auryn\Configuration\ConfigurationSet;

class AcmeConfigurationSet extends ConfigurationSet
{
    public function __construct()
    {
        parent::__construct([
            FooConfiguration::class,
            BarConfiguration::class,
            // ...
        ]);
    }
}

$injector = new Injector;

$configuration = $injector->make(FooConfiguration::class);
$configuration($injector);

$set = $injector->make(AcmeConfigurationSet::clss);
$set($injector);