PHPackages                             andyvanee/containable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. andyvanee/containable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andyvanee/containable
=====================

A small DI container

1.0(7y ago)015MITPHP

Since Feb 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/andyvanee/Containable)[ Packagist](https://packagist.org/packages/andyvanee/containable)[ RSS](/packages/andyvanee-containable/feed)WikiDiscussions master Synced yesterday

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

Containable
===========

[](#containable)

A small DI container implementation in PHP. Conforms to the PSR11 interface which it augments with services and factories.

### Usage

[](#usage)

```
$container = new Containable\Containable;

// Simple key value storage
$container->set('x', 1);
$container->has('x'); // => true
$container->get('x'); // => 1

// Store and call functions
$container->set('+', function($a, $b) {
    return $a + $b;
});

$container->get('+')(5, 7); // => 12

// Container-aware service function. This function is only called once on
// first use, and the returned value is stored for any subsequent calls
// to get()
$container->service('my-service', function($c) {
    return new Service($c->get('x'));
});

$container->get('my-service'); // => Singleton object

// Container-aware factory function. This function is called with the
// container on every call to get()
$container->factory('my-instance', function($c) {
    return new Instance($c->get('x'));
});

$container->get('my-instance'); // => New Object
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

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 ~0 days

Total

2

Last Release

2638d ago

Major Versions

0.1 → 1.02019-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/09ea741eb707c8cb81cb42811e3080efe58f2087df7e5e6808687d819119f3c9?d=identicon)[andyvanee](/maintainers/andyvanee)

---

Top Contributors

[![andyvanee](https://avatars.githubusercontent.com/u/212280?v=4)](https://github.com/andyvanee "andyvanee (2 commits)")

### Embed Badge

![Health badge](/badges/andyvanee-containable/health.svg)

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

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k431.1M7.5k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

704122.9M10.1k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31278.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)

PHPackages © 2026

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