Skip to content
Simple and lightweight Dependency Injection Container
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

FlameCore Container

Build Status Scrutinizer Coverage License

This library provides a simple and lightweight Dependency Injection Container.


  • Interfaces: Extended container interfaces compatible with container-interop

    • EditableContainerInterface

    • LockableContainerInterface

  • Classes: Advanced and feature-complete container implementations based on the interfaces

    • EditableContainer

    • LockableContainer


To make use of the API, include the vendor autoloader and use the classes:

namespace Acme\MyApplication;

use FlameCore\Container\EditableContainer;

$container = new EditableContainer();

You can define() items to require a value type. To assign values to items, use the set() method.

$container->define('bar', 'Acme\MyApplication\Config'); // or 'Config::class'
$container->set('bar', new Config());

This works also with arrays and scalar types:

$container->define('foo', ':string');
$container->set('foo', 'bar');


Install via Composer

Install Composer if you don't already have it present on your system:

$ curl -sS | php

To install the library, run the following command and you will get the latest version:

$ composer require flamecore/container


  • You must have at least PHP version 5.4 installed on your system.


If you want to contribute, please see the CONTRIBUTING file first.

Thanks to the contributors:

  • Christian Neff (secondtruth)
You can’t perform that action at this time.