PHPackages                             yarfox/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. yarfox/container

AbandonedArchivedLibrary

yarfox/container
================

psr-11 container

1.0.0-alpha(3y ago)3241MITPHP

Since Jul 24Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

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

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1393d 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/yarfox-container/health.svg)

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

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/json-streamer

Provides powerful methods to read/write data structures from/into JSON streams.

14440.0k8](/packages/symfony-json-streamer)[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

632.3k](/packages/rubix-server)

PHPackages © 2026

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