(WIP)DI Container
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE.md
README.md
composer.json
composer.lock

README.md

hirak/kibi

Auto Dependency Injection Container

Requirements

  • PHP >= 7
  • composer >= 1.2

Example

<?php
require 'vendor/autoload.php';
$container = new Hirak\Kibi\Instantiator;
$container->addTrait(Acme\Provider::class);

/** @var Acme\Dispatcher */
$dispatcher = $container->get(Acme\Dispatcher::class);
$dispatcher->run($_SERVER, $_REQUEST);
<?php
namespace Acme;

trait Provider
{
    public function now(): DateTimeImmutable
    {
        return new DateTimeImmutable;
    }
}