ContainerInterface

Extends \Psr\Container\ContainerInterface

Dependency injection container interface

package

Kocuj\Di\Container

Methods

Add standard or shared service

add(\Kocuj\Di\Service\ServiceType $serviceType, string $id, string $source, array $arguments = array()) : \Kocuj\Di\Container\ContainerInterface

Arguments

$serviceType

\Kocuj\Di\Service\ServiceType

Service type

$id

string

Service identifier

$source

string

Service to create

$arguments

array

Service arguments to inject into constructor

Response

\Kocuj\Di\Container\ContainerInterface

This object

Add shared service

addShared(string $id, string $source, array $arguments = array()) : \Kocuj\Di\Container\ContainerInterface

Arguments

$id

string

Service identifier

$source

string

Service to create

$arguments

array

Service arguments to inject into constructor

Response

\Kocuj\Di\Container\ContainerInterface

This object

Add standard service

addStandard(string $id, string $source, array $arguments = array()) : \Kocuj\Di\Container\ContainerInterface

Arguments

$id

string

Service identifier

$source

string

Service to create

$arguments

array

Service arguments to inject into constructor

Response

\Kocuj\Di\Container\ContainerInterface

This object

Check service type

checkType(string $id, \Kocuj\Di\Service\ServiceType $serviceType) : boolean

Arguments

$id

string

Service identifier

$serviceType

\Kocuj\Di\Service\ServiceType

Service type

Response

boolean

This service has selected type (true) or not (false)

Get service type - for compatibility with 1.2.0

getType(string $id) : \Kocuj\Di\Service\ServiceType

Arguments

$id

string

Service identifier

Response

\Kocuj\Di\Service\ServiceType

Service type