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

ActiveLibrary

carousel/container
==================

Dependency Injection container for PHP projects

v1.0.0(9y ago)0721MITPHPPHP &gt;=5.3.0

Since Jan 13Pushed 8y ago2 watchersCompare

[ Source](https://github.com/carousel/container)[ Packagist](https://packagist.org/packages/carousel/container)[ Docs](http://larabal.com)[ RSS](/packages/carousel-container/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

\#Simple dependency injection container for PHP projects [![Build Status](https://camo.githubusercontent.com/6a059b60544b9892bd1d251f19b279f7057c4ce1e5fe2a326ab56e32a75034b8/68747470733a2f2f7472617669732d63692e6f72672f6361726f7573656c2f636f6e7461696e65722e737667)](https://travis-ci.org/carousel/container)

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

[](#installation)

### With Composer

[](#with-composer)

```
$ composer require carousel/container

```

composer.json

```
{
    "require": {
        "carousel/container": "0.4.0"
    }
}

```

Usage
-----

[](#usage)

```
//bind object into the container (using ArrayAccess)
$this->container['car'] = function () { return new Car(); };

//resolve
$car = $this->container['car'];

//call object method
$car->setMake('VW');

//swap binding key
$this->container->swapKey('car', 'new_car');

//resolve
$new_car = $this->container['new_car'];
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~101 days

Total

5

Last Release

3368d ago

Major Versions

v0.4.0 → v1.0.02017-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/28708cbfd84676f03d692270386152b5e7287ef08e4b88b93c7ae0e6373fc859?d=identicon)[miro](/maintainers/miro)

---

Top Contributors

[![carousel](https://avatars.githubusercontent.com/u/1110741?v=4)](https://github.com/carousel "carousel (12 commits)")[![rgr4y](https://avatars.githubusercontent.com/u/1844457?v=4)](https://github.com/rgr4y "rgr4y (1 commits)")

---

Tags

di container

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[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)[renakdup/simple-dic

Simple DI Container with autowiring for your WordPress application with NO dependencies.

101.8k1](/packages/renakdup-simple-dic)

PHPackages © 2026

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