analyzephp / container
The Analyze PHP Framework Container
Installs: 46
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/analyzephp/container
Requires
- psr/container: ^1.0@dev
Requires (Dev)
- mockery/mockery: ^1.0@dev
- phpunit/phpunit: ^7.2@dev
This package is not auto-updated.
Last update: 2025-09-28 10:06:14 UTC
README
This is the default container used in the Analyze PHP Framework. It is PSR-11 compatable.
Installation
Requirements
PHP >= 7.0.0
Via Composer
Installation via Composer is the recommended method of installation.
Basic Usage
<?php 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');