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

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

stellarwp/container-contract
============================

StellarWP Container Interface

1.1.1(2y ago)61.5M↑18%16GPL-2.0-or-laterPHPPHP &gt;=7.0.0

Since Sep 23Pushed 2y ago11 watchersCompare

[ Source](https://github.com/stellarwp/container-contract)[ Packagist](https://packagist.org/packages/stellarwp/container-contract)[ Docs](https://github.com/stellarwp/container-contract)[ RSS](/packages/stellarwp-container-contract/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)DependenciesVersions (8)Used By (6)

StellarWP Container Contract
============================

[](#stellarwp-container-contract)

Service Container interface for use in StellarWP libraries.

Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container.

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

[](#installation)

It's recommended that you install this contract as a project dependency via [Composer](https://getcomposer.org/):

```
composer require stellarwp/container-contract
```

*Note: If you typically use a tool like [Strauss](https://github.com/BrianHenryIE/strauss), you should **not** customize the namespace of this library in order to have proper compatibility with StellarWP libraries.*

Usage
-----

[](#usage)

Simply `use` the `ContainerInterface` and implement it or use it as a type hint.

```
use StellarWP\ContainerContract\ContainerInterface;

class Container implements ContainerInterface {
	public function bind( string $id, $implementation ) {}
	public function get( string $id ) {}
	public function has( string $id ) {}
	public function singleton( string $id, $implementation ) {}
}
```

Example wrappers of other containers
------------------------------------

[](#example-wrappers-of-other-containers)

- [DI52](/examples/di52/Container.php) ([repo](https://github.com/lucatume/di52))
- [PHP-DI](/examples/php-di/Container.php) ([repo](https://github.com/PHP-DI/PHP-DI))

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% 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 ~58 days

Recently: every ~86 days

Total

7

Last Release

986d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4.0

1.0.4PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3171496e198834c638911ad3c3220bec77871cdf6557eaa9e2a58d16600a1a1?d=identicon)[bordoni](/maintainers/bordoni)

![](https://www.gravatar.com/avatar/70a2847a265444714b48c64eceb3ca742baa3a56757ce65b18bd7bbbbf910312?d=identicon)[dpanta94](/maintainers/dpanta94)

![](https://www.gravatar.com/avatar/97fd764aa710e8d8263a7e3b3fececdfd736b8aad8055227bf592ddf50ad15ba?d=identicon)[stellarwp](/maintainers/stellarwp)

![](https://www.gravatar.com/avatar/ec4ef25906386b60f5f66b3d03064e3bb700bedc94ee8558918565612c74aef3?d=identicon)[johnhooks](/maintainers/johnhooks)

---

Top Contributors

[![borkweb](https://avatars.githubusercontent.com/u/430385?v=4)](https://github.com/borkweb "borkweb (20 commits)")[![defunctl](https://avatars.githubusercontent.com/u/1066195?v=4)](https://github.com/defunctl "defunctl (4 commits)")[![joshcummingsdesign](https://avatars.githubusercontent.com/u/11913201?v=4)](https://github.com/joshcummingsdesign "joshcummingsdesign (2 commits)")

---

Tags

wordpress-librarywordpress-php-librarycontainercontainer-interopPSR-11container-interface

### Embed Badge

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

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

###  Alternatives

[psr/container

Common Container Interface (PHP FIG PSR-11)

10.0k1.0B3.7k](/packages/psr-container)[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[league/tactician-container

Tactician integration for any container implementing PSR-11

7710.1M23](/packages/league-tactician-container)[slince/di

A flexible dependency injection container

20260.4k6](/packages/slince-di)[elie29/zend-phpdi-config

PSR-11 PHP-DI autowire container configurator for Laminas, Mezzio, ZF2, ZF3 and Zend Expressive applications

20238.6k7](/packages/elie29-zend-phpdi-config)

PHPackages © 2026

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