Skip to content

Handle Instance value during '__construct()' analysis #2

@erickskrauch

Description

@erickskrauch

See https://github.com/yiisoft/yii2/blob/76d6345e85c05fa874f1cefdeac94a40d9dcaa39/framework/di/Container.php#L589.

__construct() value might be an yii\di\Instance instance and it should be resolved into its type:

Yii::createObject([
    '__class' => MyClass::class,
    '__construct()' => [
        'request' => Instance::of(\yii\web\Request::class),
    ],
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions