Method | Description | |
---|---|---|
__construct ( string $containerClass = 'DI\Container' ) | ||
addDefinitions ( string | array | DI\Definition\Source\DefinitionSource $definitions ) | Add definitions to the container. | |
build ( ) : |
Build and return a container. | |
buildDevContainer ( ) : |
Build a container configured for the dev environment. | |
ignorePhpDocErrors ( boolean $bool ) : |
Enable or disable ignoring phpdoc errors (non-existent classes in @param or @var). | |
setDefinitionCache ( Doctrine\Common\Cache\Cache $cache ) : |
Enables the use of a cache for the definitions. | |
useAnnotations ( boolean $bool ) : |
Enable or disable the use of annotations to guess injections. | |
useAutowiring ( boolean $bool ) : |
Enable or disable the use of autowiring to guess injections. | |
wrapContainer ( Interop\Container\ContainerInterface $otherContainer ) | If PHP-DI's container is wrapped by another container, we can set this so that PHP-DI will use the wrapper rather than itself for building objects. | |
writeProxiesToFile ( boolean $writeToFile, string | null $proxyDirectory = null ) : |
Configure the proxy generation. |
Method | Description | |
---|---|---|
ensureNotLocked ( ) |
public __construct ( string $containerClass = 'DI\Container' ) | ||
$containerClass | string | Name of the container class, used to create the container. |
public addDefinitions ( string | array | DI\Definition\Source\DefinitionSource $definitions ) | ||
$definitions | string | array | DI\Definition\Source\DefinitionSource | Can be an array of definitions, the name of a file containing definitions or a DefinitionSource object. |
public static buildDevContainer ( ) : |
||
return |
public ignorePhpDocErrors ( boolean $bool ) : |
||
$bool | boolean | |
return |
public setDefinitionCache ( Doctrine\Common\Cache\Cache $cache ) : |
||
$cache | Doctrine\Common\Cache\Cache | Cache backend to use |
return |
public useAnnotations ( boolean $bool ) : |
||
$bool | boolean | |
return |
public useAutowiring ( boolean $bool ) : |
||
$bool | boolean | |
return |
public wrapContainer ( Interop\Container\ContainerInterface $otherContainer ) | ||
$otherContainer | Interop\Container\ContainerInterface |