PHP code example of buzzingpixel / corbomite-di

1. Go to this page and download the library: Download buzzingpixel/corbomite-di 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/ */

    

buzzingpixel / corbomite-di example snippets



declare(strict_types=1);

use some\Dependency;
use some\OtherDependency;
use my\namespaced\CoolClass;
use my\namespaced\AnotherCoolClass;

return [
    CoolClass::class => function () {
        return new CoolClass(new Dependency());
    },
    AnotherCoolClass::class => function () {
        return new AnotherCoolClass(
            new Dependency(),
            new OtherDependency()
        );
    },
];