PHP Class Nette\DI\ContainerBuilder

Inheritance: extends Nette\Object
Afficher le fichier Open project: nette/di Class Usage Examples

Méthodes publiques

Свойство Type Description
$parameters array

Méthodes publiques

Méthode Description
addAlias ( $alias, $service )
addDefinition ( $name, ServiceDefinition $definition = NULL ) : ServiceDefinition Adds new service definition.
addDependency ( $dep ) : self Adds item to the list of dependencies.
addExcludedClasses ( array $classes ) : self
autowireArguments ( $class, $method, array $arguments ) : array Creates a list of arguments using autowiring.
complete ( ) : void
completeStatement ( Statement $statement ) : Statement
expand ( $value ) : mixed Expands %placeholders% in strings.
findByTag ( $tag ) : array Gets the service objects of the specified tag.
findByType ( $class ) : ServiceDefinition[] Gets the service names and definitions of the specified type.
formatPhp ( $statement, $args )
formatStatement ( Statement $statement )
generateClasses ( $className = 'Container', $parentName = NULL )
getAliases ( ) : array Gets all service aliases.
getByType ( $class ) : string | null Resolves service name by type.
getClassList ( )
getClassName ( )
getDefinition ( $name ) : ServiceDefinition Gets the service definition.
getDefinitions ( ) : ServiceDefinition[] Gets all service definitions.
getDependencies ( ) : array Returns the list of dependencies.
getServiceName ( $arg ) : string Converts @service or @\Class -> service name and checks its existence.
hasDefinition ( $name ) : boolean Does the service definition or alias exist?
literal ( $phpCode ) : Nette\PhpGenerator\PhpLiteral
normalizeEntity ( $entity )
prepareClassList ( ) : array Generates $dependencies, $classes and normalizes class names.
removeAlias ( $alias ) : void Removes the specified alias.
removeDefinition ( $name ) : void Removes the specified service definition.
setClassName ( $name )

Private Methods

Méthode Description
checkCase ( $class )
resolveEntityClass ( $entity, $recursive = [] ) : string | null
resolveImplement ( ServiceDefinition $def, $name )
resolveServiceClass ( $name, $recursive = [] ) : string | null

Method Details

addAlias() public méthode

public addAlias ( $alias, $service )

addDefinition() public méthode

Adds new service definition.
public addDefinition ( $name, ServiceDefinition $definition = NULL ) : ServiceDefinition
$definition ServiceDefinition
Résultat ServiceDefinition

addDependency() public méthode

Adds item to the list of dependencies.
public addDependency ( $dep ) : self
Résultat self

addExcludedClasses() public méthode

public addExcludedClasses ( array $classes ) : self
$classes array
Résultat self

autowireArguments() public méthode

Creates a list of arguments using autowiring.
public autowireArguments ( $class, $method, array $arguments ) : array
$arguments array
Résultat array

complete() public méthode

public complete ( ) : void
Résultat void

completeStatement() public méthode

public completeStatement ( Statement $statement ) : Statement
$statement Statement
Résultat Statement

expand() public méthode

Expands %placeholders% in strings.
Deprecation:
public expand ( $value ) : mixed
Résultat mixed

findByTag() public méthode

Gets the service objects of the specified tag.
public findByTag ( $tag ) : array
Résultat array of [service name => tag attributes]

findByType() public méthode

Gets the service names and definitions of the specified type.
public findByType ( $class ) : ServiceDefinition[]
Résultat ServiceDefinition[]

formatPhp() public méthode

Deprecation:
public formatPhp ( $statement, $args )

formatStatement() public méthode

Deprecation:
public formatStatement ( Statement $statement )
$statement Statement

generateClasses() public méthode

Deprecation:
public generateClasses ( $className = 'Container', $parentName = NULL )

getAliases() public méthode

Gets all service aliases.
public getAliases ( ) : array
Résultat array

getByType() public méthode

Resolves service name by type.
public getByType ( $class ) : string | null
Résultat string | null service name or NULL

getClassList() public méthode

public getClassList ( )

getClassName() public méthode

Deprecation:
public getClassName ( )

getDefinition() public méthode

Gets the service definition.
public getDefinition ( $name ) : ServiceDefinition
Résultat ServiceDefinition

getDefinitions() public méthode

Gets all service definitions.
public getDefinitions ( ) : ServiceDefinition[]
Résultat ServiceDefinition[]

getDependencies() public méthode

Returns the list of dependencies.
public getDependencies ( ) : array
Résultat array

getServiceName() public méthode

Converts @service or @\Class -> service name and checks its existence.
public getServiceName ( $arg ) : string
Résultat string of FALSE, if argument is not service name

hasDefinition() public méthode

Does the service definition or alias exist?
public hasDefinition ( $name ) : boolean
Résultat boolean

literal() public static méthode

public static literal ( $phpCode ) : Nette\PhpGenerator\PhpLiteral
Résultat Nette\PhpGenerator\PhpLiteral

normalizeEntity() public méthode

public normalizeEntity ( $entity )

prepareClassList() public méthode

Generates $dependencies, $classes and normalizes class names.
public prepareClassList ( ) : array
Résultat array

removeAlias() public méthode

Removes the specified alias.
public removeAlias ( $alias ) : void
Résultat void

removeDefinition() public méthode

Removes the specified service definition.
public removeDefinition ( $name ) : void
Résultat void

setClassName() public méthode

Deprecation:
public setClassName ( $name )

Property Details

$parameters public_oe property

public array $parameters
Résultat array