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

AbandonedArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

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 3w 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 13% 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

1441d 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

[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k65.9M137](/packages/symfony-contracts)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[api-platform/state

API Platform state interfaces

274.9M136](/packages/api-platform-state)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

187557.3k3](/packages/wikimedia-parsoid)[testo/testo

A lightweight PHP testing framework.

1959.3k55](/packages/testo-testo)

PHPackages © 2026

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