PHP Class ManaPHP\Di

Inheritance: implements manaphp\DiInterface
Afficher le fichier Open project: manaphp/manaphp Class Usage Examples

Protected Properties

Свойство Type Description
$_aliases array
$_default Di First DI build
$_services array
$_sharedInstances array

Méthodes publiques

Méthode Description
__call ( string $method, array $arguments = [] ) : void Magic method to get or set services using setters/getters
__construct ( )
__debugInfo ( ) : array
__get ( string $propertyName ) : mixed Magic method __get
__isset ( string $name ) : boolean
__set ( string $name, mixed $value )
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 service, the resolved service is stored in the DI, subsequent requests for this service will return the same instance
has ( string $name ) : boolean Check whether the DI contains a service by a name
remove ( string $name ) : static Removes a service in the services container
set ( string $name, mixed $definition, boolean $shared = false, array $aliases = [] ) : static Registers a service in the services container
setShared ( string $name, mixed $definition, array $aliases = [] ) : static Registers an "always shared" service in the services container

Method Details

__call() public méthode

Magic method to get or set services using setters/getters
public __call ( string $method, array $arguments = [] ) : void
$method string
$arguments array
Résultat void

__construct() public méthode

public __construct ( )

__debugInfo() public méthode

public __debugInfo ( ) : array
Résultat array

__get() public méthode

Magic method __get
public __get ( string $propertyName ) : mixed
$propertyName string
Résultat mixed

__isset() public méthode

public __isset ( string $name ) : boolean
$name string
Résultat boolean

__set() public méthode

public __set ( string $name, mixed $value )
$name string
$value mixed

get() public méthode

Resolves the service based on its configuration
public get ( string $_name, array $parameters = [] ) : mixed
$_name string
$parameters array
Résultat mixed

getDefault() public static méthode

Return the First DI created
public static getDefault ( ) : static
Résultat static

getShared() public méthode

Resolves a service, the resolved service is stored in the DI, subsequent requests for this service will return the same instance
public getShared ( string $name, array $parameters = [] ) : mixed
$name string
$parameters array
Résultat mixed

has() public méthode

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

remove() public méthode

Removes a service in the services container
public remove ( string $name ) : static
$name string
Résultat static

set() public méthode

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

setShared() public méthode

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

Property Details

$_aliases protected_oe property

protected array $_aliases
Résultat array

$_default protected_oe static_oe property

First DI build
protected static Di,ManaPHP $_default
Résultat Di

$_services protected_oe property

protected array $_services
Résultat array

$_sharedInstances protected_oe property

protected array $_sharedInstances
Résultat array