0 follower

Interface Yiisoft\Definitions\Contract\DefinitionInterface

Implemented byYiisoft\Definitions\ArrayDefinition, Yiisoft\Definitions\CallableDefinition, Yiisoft\Definitions\Contract\ReferenceInterface, Yiisoft\Definitions\ParameterDefinition, Yiisoft\Definitions\ValueDefinition

Definition is describing a way to create and configure a service or an object.

Public Methods

Hide inherited methods

Method Description Defined By
resolve() Resolve this definition. Yiisoft\Definitions\Contract\DefinitionInterface

Method Details

Hide inherited methods

resolve() public abstract method

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;