PHPackages                             bizley/deep-instantiate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bizley/deep-instantiate

AbandonedArchivedYii2-extension

bizley/deep-instantiate
=======================

Deep Instantiator for Yii 2.

1.0.0(5y ago)00BSD-3-ClausePHPPHP &gt;=7.0

Since Mar 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bizley/yii2-deep-instantiate)[ Packagist](https://packagist.org/packages/bizley/deep-instantiate)[ GitHub Sponsors](https://github.com/sponsors/bizley)[ RSS](/packages/bizley-deep-instantiate/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Yii 2 Deep Instantiate
======================

[](#yii-2-deep-instantiate)

[![Latest Stable Version](https://camo.githubusercontent.com/d0657074cb4763b0d41c77dc6b82e656b7b27dc836426803270965e4ea4c6b0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62697a6c65792f646565702d696e7374616e74696174652e737667)](https://camo.githubusercontent.com/d0657074cb4763b0d41c77dc6b82e656b7b27dc836426803270965e4ea4c6b0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62697a6c65792f646565702d696e7374616e74696174652e737667)[![Total Downloads](https://camo.githubusercontent.com/a4e45da816f88270357a57524554f0f453efd94c17240500200249daf4b7c112/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62697a6c65792f646565702d696e7374616e74696174652e737667)](https://packagist.org/packages/bizley/deep-instantiate)[![License](https://camo.githubusercontent.com/dbd4f2987b60da523a8147cf587641dc3d2358bf38c2265b0b2c16222e187723/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62697a6c65792f646565702d696e7374616e74696174652e737667)](https://camo.githubusercontent.com/dbd4f2987b60da523a8147cf587641dc3d2358bf38c2265b0b2c16222e187723/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62697a6c65792f646565702d696e7374616e74696174652e737667)[![Mutation testing badge](https://camo.githubusercontent.com/535decfdea54eb8324b7d6189de41128ac490f5213debd54bc7db4c5f2048a64/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324662697a6c6579253246796969322d646565702d696e7374616e74696174652532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/bizley/yii2-deep-instantiate/main)

This package provides Yii 2 Dependency Injector Container capable of automatically resolving nested constructor interface-typed dependencies.

### Requirements

[](#requirements)

- Yii 2.0.39.3+
- PHP 7.0+

### Installation

[](#installation)

```
composer require bizley/deep-instantiate:^1.0

```

### Usage

[](#usage)

Directly - just call `new \Bizley\DeepInstantiate\Container()`.
Globally - set `\Yii::$container = new \Bizley\DeepInstantiate\Container();` in your entry script.

### Enhanced Instantiating

[](#enhanced-instantiating)

```
class Alpha implements AlphaInterface
{
    private $beta;

    public function __construct(BetaInterface $beta)
    {
        $this->beta = $beta;
    }
}

class Beta implements BetaInterface
{
}

class Gamma
{
    private $alpha;

    public function __construct(AlphaInterface $alpha)
    {
        $this->alpha = $alpha;
    }
}
```

With the original Container:

```
$container->set(BetaInterface::class, Beta::class);
$alpha = $container->get(Alpha::class);
```

With Deep Instantiate Container you just need:

```
$alpha = $container->get(Alpha::class, [Beta::class]);
```

For nested dependencies with the original Container:

```
$container->set(AlphaInterface::class, Alpha::class);
$container->set(BetaInterface::class, Beta::class);
$gamma = $container->get(Gamma::class);
```

For nested dependencies with Deep Instantiate Container:

```
$gamma = $container->get(Gamma::class, [
    [
        'class' => Alpha::class,
        '__construct()' => Beta::class
    ]
]);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1889d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b33b799410f9cb8d69a27bce7ae65d5c0a0aa8e097b2624c2f5315400d653b38?d=identicon)[bizley](/maintainers/bizley)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")

---

Tags

dependency-injectiondiyii2

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bizley-deep-instantiate/health.svg)

```
[![Health](https://phpackages.com/badges/bizley-deep-instantiate/health.svg)](https://phpackages.com/packages/bizley-deep-instantiate)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
