The Analyze PHP Framework Container

dev-master 2018-07-24 00:53 UTC

This package is not auto-updated.

Last update: 2024-02-18 01:24:24 UTC


This is the default container used in the Analyze PHP Framework. It is PSR-11 compatable.



PHP >= 7.0.0

Via Composer

Installation via Composer is the recommended method of installation.

Basic Usage


use Analyze\Container\Container;

// Create a new Container instance
$container = new Container;

// Add via Factory
$this->addFactory('AwesomePackage', function() {
    return new Some\Awesome\Package;

// Add via Constructor
$this->addClass('AwesomePackage', Some\Awesome\Package::class);

// Add via Setter
$this->addSetter('AwesomePackage', 'Some\Awesome\Package', [
    'setName' => 'Bob'

// Return a new instance
$awesome = $container->get('AwesomePackage');