PHP Класс ManaPHP\Di

Наследование: implements manaphp\DiInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_aliases array
$_default Di First DI build
$_services array
$_sharedInstances array

Открытые методы

Метод Описание
__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

Описание методов

__call() публичный Метод

Magic method to get or set services using setters/getters
public __call ( string $method, array $arguments = [] ) : void
$method string
$arguments array
Результат void

__construct() публичный Метод

public __construct ( )

__debugInfo() публичный Метод

public __debugInfo ( ) : array
Результат array

__get() публичный Метод

Magic method __get
public __get ( string $propertyName ) : mixed
$propertyName string
Результат mixed

__isset() публичный Метод

public __isset ( string $name ) : boolean
$name string
Результат boolean

__set() публичный Метод

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

get() публичный Метод

Resolves the service based on its configuration
public get ( string $_name, array $parameters = [] ) : mixed
$_name string
$parameters array
Результат mixed

getDefault() публичный статический Метод

Return the First DI created
public static getDefault ( ) : static
Результат static

getShared() публичный Метод

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
Результат mixed

has() публичный Метод

Check whether the DI contains a service by a name
public has ( string $name ) : boolean
$name string
Результат boolean

remove() публичный Метод

Removes a service in the services container
public remove ( string $name ) : static
$name string
Результат static

set() публичный Метод

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
Результат static

setShared() публичный Метод

Registers an "always shared" service in the services container
public setShared ( string $name, mixed $definition, array $aliases = [] ) : static
$name string
$definition mixed
$aliases array
Результат static

Описание свойств

$_aliases защищенное свойство

protected array $_aliases
Результат array

$_default защищенное статическое свойство

First DI build
protected static Di,ManaPHP $_default
Результат Di

$_services защищенное свойство

protected array $_services
Результат array

$_sharedInstances защищенное свойство

protected array $_sharedInstances
Результат array