Download the PHP package fyre/container without Composer
On this page you can find all versions of the php package fyre/container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package container
FyreContainer
FyreContainer is a free, open-source container library for PHP.
Table Of Contents
- Installation
- Basic Usage
- Methods
- Static Methods
Installation
Using Composer
In PHP:
Basic Usage
$bind
is a boolean indicating whether to bind the container instance to itself, and will default to true.
Methods
Bind
Bind an alias to a factory Closure or class name.
$alias
is a string representing the alias.$factory
is a string representing the class name, or a Closure that returns an instance of the class, and will default to the$alias
.
Bind Attribute
Bind a contextual attribute to a handler.
$attribute
is a string representing the attribute.$handler
is a Closure that will resolve a value from the attribute.
Build
Build a class name, injecting dependencies as required.
$className
is a string representing the class name.$arguments
is an array containing the named arguments for the class constructor.
Call
Execute a callable using resolved dependencies.
$callable
is an array, string or object representing the callable.$arguments
is an array containing the named arguments for the callabck.
Clear Scoped
Clear the scoped instances.
Instance
Bind an alias to a class instance.
$alias
is a string representing the alias.$instance
is an object representing the class instance.
Scoped
Bind an alias to a factory Closure or class name as a reusable scoped instance.
$alias
is a string representing the alias.$factory
is a string representing the class name, or a Closure that returns an instance of the class, and will default to the$alias
.
Singleton
Bind an alias to a factory Closure or class name as a reusable instance.
$alias
is a string representing the alias.$factory
is a string representing the class name, or a Closure that returns an instance of the class, and will default to the$alias
.
Use
Use an instance of a class.
$alias
is a string representing the alias.$arguments
is an array containing the named arguments for the class constructor.
Static Methods
Get Instance
Get the global instance.
Set Instance
Set the global instance.
$container
is a Container.