Final Class Yiisoft\Hydrator\ObjectFactory\ContainerObjectFactory
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
A factory for objects that are instantiable by a container.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| create() | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $injector | \ |
|
public function __construct(
private Injector $injector,
) {}
| public object create ( ReflectionClass $reflectionClass, array $constructorArguments ) | ||
| $reflectionClass | ReflectionClass | |
| $constructorArguments | array | |
| throws | \ |
|
|---|---|---|
| throws | ReflectionException | |
public function create(ReflectionClass $reflectionClass, array $constructorArguments): object
{
$class = $reflectionClass->getName();
return $this->injector->make($class, $constructorArguments);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.