Final Class Yiisoft\Di\ContainerConfig
| Inheritance | Yiisoft\Di\ContainerConfig |
|---|---|
| Implements | Yiisoft\Di\ContainerConfigInterface |
Container configuration.
Public Methods
Method Details
| public array getDefinitions ( ) |
public function getDefinitions(): array
{
return $this->definitions;
}
| public boolean shouldValidate ( ) |
public function shouldValidate(): bool
{
return $this->validate;
}
| public boolean useStrictMode ( ) |
public function useStrictMode(): bool
{
return $this->useStrictMode;
}
| public self withDefinitions ( array $definitions ) | ||
| $definitions | array |
Definitions to put into container. |
public function withDefinitions(array $definitions): self
{
$new = clone $this;
$new->definitions = $definitions;
return $new;
}
| public self withDelegates ( array $delegates ) | ||
| $delegates | array |
Container delegates. Each delegate is a callable in format
|
public function withDelegates(array $delegates): self
{
$new = clone $this;
$new->delegates = $delegates;
return $new;
}
| public self withProviders ( array $providers ) | ||
| $providers | array |
Service providers to get definitions from. |
public function withProviders(array $providers): self
{
$new = clone $this;
$new->providers = $providers;
return $new;
}
| public self withStrictMode ( boolean $useStrictMode = true ) | ||
| $useStrictMode | boolean |
If the automatic addition of definition when class exists and can be resolved is disabled. |
public function withStrictMode(bool $useStrictMode = true): self
{
$new = clone $this;
$new->useStrictMode = $useStrictMode;
return $new;
}
| public self withTags ( array $tags ) | ||
| $tags | array |
Tagged service IDs. The structure is |
public function withTags(array $tags): self
{
$new = clone $this;
$new->tags = $tags;
return $new;
}
| public self withValidate ( boolean $validate = true ) | ||
| $validate | boolean |
Whether definitions should be validated immediately. |
public function withValidate(bool $validate = true): self
{
$new = clone $this;
$new->validate = $validate;
return $new;
}
Signup or Login in order to comment.