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

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

frostealth/php-container
========================

Simple Dependency Injection Container

2.0.0(10y ago)036MITPHPPHP &gt;=5.4.0

Since Aug 29Pushed 10y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

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

[](#php-container)

Simple Dependency Injection Container.

Installation
------------

[](#installation)

Run the [Composer](http://getcomposer.org/download/) command to install the latest stable version:

```
composer require frostealth/php-container @stable

```

Usage
-----

[](#usage)

```
use frostealth\Container\Container;

$container = new Container();

// ...

// injecting simple values
$container->set('foo', 'bar'); // or $container->foo = 'bar';

// get its value
$value = $container->get('foo');  // or $value = $container->foo;

// ...

// resources
$container->set('object', function ($container) {
    return new MyObject($container->foo);
});

// get a new instance
$object = $container->get('object');

// ...

// singleton resources
$container->singleton('log', function ($container) {
    return new MyLog($container->object);
});

// get log resource
$log = $container->get('log');
```

Dependency Injection
--------------------

[](#dependency-injection)

```
use Interop\Container\ContainerInterface;

class MyClass
{
    /**
     * @var ContainerInterface
     */
    protected $container;

    /**
     * @param ContainerInterface $container
     */
    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }
}
```

License
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](https://github.com/frostealth/php-container/blob/master/LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~145 days

Total

4

Last Release

3843d ago

Major Versions

1.0.2 → 2.0.02015-11-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/3209d007425f192de0e0941e6181d2dfd36ed4f00714675ca7fb525c6fd27ed2?d=identicon)[frostealth](/maintainers/frostealth)

---

Top Contributors

[![frostealth](https://avatars.githubusercontent.com/u/1785217?v=4)](https://github.com/frostealth "frostealth (5 commits)")

---

Tags

dependency-injectionphp-containercontainerdependency-injectiondi

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[aura/di

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

356968.3k58](/packages/aura-di)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3611.7M3](/packages/mrclay-props-dic)[slince/di

A flexible dependency injection container

20260.4k6](/packages/slince-di)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2857.5k2](/packages/capsule-di)

PHPackages © 2026

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