PHP Interface ManaPHP\DiInterface

Show file Open project: manaphp/manaphp

Public Methods

Method Description
get ( string $name, array $parameters = [] ) : mixed Resolves the service based on its configuration
getDefault ( ) : static Return the First DI created
getShared ( string $name, array $parameters = [] ) : mixed Resolves a shared service based on their configuration
has ( string $name ) : boolean Check whether the DI contains a service by a name
remove ( string $name ) : static Removes a service from the service container
set ( string $name, mixed $definition, boolean $shared = false, array $aliases = [] ) : static Registers a service in the service container
setShared ( string $name, mixed $definition, array $aliases = [] ) : static Registers an "always shared" service in the services container

Method Details

get() public method

Resolves the service based on its configuration
public get ( string $name, array $parameters = [] ) : mixed
$name string
$parameters array
return mixed

getDefault() public static method

Return the First DI created
public static getDefault ( ) : static
return static

getShared() public method

Resolves a shared service based on their configuration
public getShared ( string $name, array $parameters = [] ) : mixed
$name string
$parameters array
return mixed

has() public method

Check whether the DI contains a service by a name
public has ( string $name ) : boolean
$name string
return boolean

remove() public method

Removes a service from the service container
public remove ( string $name ) : static
$name string
return static

set() public method

Registers a service in the service container
public set ( string $name, mixed $definition, boolean $shared = false, array $aliases = [] ) : static
$name string
$definition mixed
$shared boolean
$aliases array
return static

setShared() public method

Registers an "always shared" service in the services container
public setShared ( string $name, mixed $definition, array $aliases = [] ) : static
$name string
$definition mixed
$aliases array
return static