PHPackages                             sherv/wp-di-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. sherv/wp-di-container

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

sherv/wp-di-container
=====================

PSR-11 compliant dependency injection container for WordPress plugin development.

v1.0.0(2mo ago)0110↓70.5%[1 PRs](https://github.com/shervElmi/wp-di-container/pulls)1MITPHPPHP &gt;=8.2CI passing

Since Apr 13Pushed 3w agoCompare

[ Source](https://github.com/shervElmi/wp-di-container)[ Packagist](https://packagist.org/packages/sherv/wp-di-container)[ Docs](https://github.com/shervElmi/wp-di-container)[ RSS](/packages/sherv-wp-di-container/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (7)Versions (7)Used By (1)

WP DI Container
===============

[](#wp-di-container)

A [PSR-11](https://www.php-fig.org/psr/psr-11/) compliant dependency injection container for WordPress plugin development.

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/f2a8ce481f9787833e7d3330d6cdf3f1494f984301cbeaf6bc14fcfc34efc316/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e322d626c7565)](https://www.php.net/)

Requirements
------------

[](#requirements)

- PHP 8.2+
- Composer
- WordPress (used within a WordPress plugin or theme)

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

[](#installation)

```
composer require sherv/wp-di-container
```

Quick Start
-----------

[](#quick-start)

```
use Sherv\Container\Container;

$container = new Container();

// Bind an interface to a concrete implementation.
$container->bind( Logger_Contract::class, File_Logger::class );

// Resolve. File_Logger and all its dependencies are built automatically.
$logger = $container->make( Logger_Contract::class );
```

Documentation
-------------

[](#documentation)

1. **[Introduction](./docs/01-introduction.md)**: Overview, features, and quick start.
2. **[Architecture](./docs/02-architecture.md)**: Components overview and UML diagram.
3. **[Container](./docs/03-container.md)**: Binding, resolving, singletons, extensions, and factory.
4. **[Exceptions](./docs/04-exceptions.md)**: Error handling reference.

Development
-----------

[](#development)

To get started, clone the repository and install dependencies:

```
git clone https://github.com/shervElmi/wp-di-container.git
cd wp-di-container
composer install
```

### Scripts

[](#scripts)

CommandDescription`composer test`Run the test suite`composer test:coverage`Run tests with code coverage`composer lint`Run PHP CodeSniffer`composer format`Auto-fix coding standards violationsContributing
------------

[](#contributing)

Contributions are welcome. Please open an issue or pull request on [GitHub](https://github.com/shervElmi/wp-di-container).

Security
--------

[](#security)

To report a security vulnerability, please see [SECURITY.md](SECURITY.md).

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for a history of notable changes.

License
-------

[](#license)

© Sherv Elmi. Licensed under the [MIT License](LICENSE). Distributed without any warranty. See the license for details.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance91

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

78d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61981da817994edacc5545ad8c6a507b88365f1d86f42b56faacc1af1e590b9c?d=identicon)[ShervElmi](/maintainers/ShervElmi)

---

Top Contributors

[![shervElmi](https://avatars.githubusercontent.com/u/69119241?v=4)](https://github.com/shervElmi "shervElmi (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")

---

Tags

containerPSR-11wordpressdependency-injectiondiioc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sherv-wp-di-container/health.svg)

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k53.2M1.2k](/packages/php-di-php-di)[slince/di

A flexible dependency injection container

20268.4k6](/packages/slince-di)

PHPackages © 2026

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