PHPackages                             anhoder/container - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. anhoder/container

Abandoned → [yarfox/container](/?search=yarfox%2Fcontainer)ArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

anhoder/container
=================

psr-11 container

1.0.3(3y ago)318MITPHP

Since Jul 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/yarfox/container)[ Packagist](https://packagist.org/packages/anhoder/container)[ RSS](/packages/anhoder-container/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (3)Versions (6)Used By (0)

PHP Container
=============

[](#php-container)

Another container in PHP.

Requirement
-----------

[](#requirement)

```
php>=8.0

```

Install
-------

[](#install)

```
composer require yarfox/container
```

Usage
-----

[](#usage)

```
abstract class AA {}

class AAI extends AA{}

class A {
}
class B {
    public function __construct(A $a)
    {
    }
}
class C {
    public function __construct(B $b, int $a = 123)
    {
    }
}
class D {
    public function __construct(A $a, AA $b)
    {}
}

$container = Container::instance();
$container->registerProducer('a', function () {
    return new A();
});
$container->resolve('a'); // get A()
$container->resolve(A::class); // get A()
$container->resolve(C::class); // get C()
$container->resolve(D::class); // throw Container Exception: AA is not instantiable!

$container->registerInstance(AA::class, $container->resolveClass(AAI::class)); // AA::class => AAI()
$container->resolve(D::class); // get D()
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.4% 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

Every ~1 days

Total

5

Last Release

1391d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27605589?v=4)[anhoder](/maintainers/anhoder)[@anhoder](https://github.com/anhoder)

---

Top Contributors

[![anhoder](https://avatars.githubusercontent.com/u/27605589?v=4)](https://github.com/anhoder "anhoder (11 commits)")[![anhoderai](https://avatars.githubusercontent.com/u/125627975?v=4)](https://github.com/anhoderai "anhoderai (10 commits)")

---

Tags

containerphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anhoder-container/health.svg)

```
[![Health](https://phpackages.com/badges/anhoder-container/health.svg)](https://phpackages.com/packages/anhoder-container)
```

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[league/container

A fast and intuitive dependency injection container.

86387.8M343](/packages/league-container)[lctrs/psalm-psr-container-plugin

Let Psalm understand better psr11 containers

17648.1k13](/packages/lctrs-psalm-psr-container-plugin)[phpwatch/simple-container

A fast and minimal PSR-11 compatible Dependency Injection Container with array-syntax and without auto-wiring

1810.1k2](/packages/phpwatch-simple-container)

PHPackages © 2026

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