library container
The Analyze PHP Framework Container
analyzephp/container
The Analyze PHP Framework Container
- Tuesday, July 24, 2018
- by SparksCoding
- Repository
- 1 Watchers
- 0 Stars
- 4 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Analyze PHP Container
This is the default container used in the Analyze PHP Framework. It is PSR-11 compatable., (*1)
Installation
Requirements
PHP >= 7.0.0, (*2)
Via Composer
Installation via Composer is the recommended method of installation., (*3)
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');
dev-master
9999999-dev
The Analyze PHP Framework Container
Sources
Download
MIT
The Requires
The Development Requires
by
Matt Sparks