Interface Yiisoft\Definitions\Contract\DefinitionInterface
Definition is describing a way to create and configure a service or an object.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| resolve() | Resolve this definition. | Yiisoft\Definitions\Contract\DefinitionInterface |
Method Details
Resolve this definition.
| public abstract mixed|null resolve ( \Psr\Container\ContainerInterface $container ) | ||
| $container | \Psr\Container\ContainerInterface | |
| return | mixed|null |
Ready to use object or null if definition can not be resolved and is marked as optional. |
|---|---|---|
| throws | Yiisoft\Definitions\Exception\InvalidConfigException |
If an object of incorrect type was created. |
| throws | Yiisoft\Definitions\Exception\CircularReferenceException |
If there is a circular reference detected when resolving the definition. |
| throws | \Psr\Container\NotFoundExceptionInterface |
If container does not know how to resolve the definition. |
| throws | Yiisoft\Definitions\Exception\NotInstantiableException |
If an object can not be instantiated. |
public function resolve(ContainerInterface $container): mixed;
Signup or Login in order to comment.