PHPackages                             phpfox/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. [Framework](/categories/framework)
4. /
5. phpfox/container

ActiveLibrary[Framework](/categories/framework)

phpfox/container
================

A simple DI container for the PHPFox framework

0.3.0(4y ago)412.7k↑90.5%11MITPHPPHP ^8.0

Since Jun 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/PHP-Fox/container)[ Packagist](https://packagist.org/packages/phpfox/container)[ GitHub Sponsors](https://github.com/JustSteveKing)[ RSS](/packages/phpfox-container/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (1)

PHP-Fox Container
=================

[](#php-fox-container)

[![GitHub release (latest by date)](https://camo.githubusercontent.com/40e6172bc5afba0fdbd42b6146ac2010ee3820a58799a7e236b682b188c8f778/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068702d666f782f636f6e7461696e6572)](https://camo.githubusercontent.com/40e6172bc5afba0fdbd42b6146ac2010ee3820a58799a7e236b682b188c8f778/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068702d666f782f636f6e7461696e6572)[![tests](https://github.com/PHP-Fox/container/workflows/run-tests/badge.svg)](https://github.com/PHP-Fox/container/workflows/run-tests/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/131c6caa7dfe755e979d1d58541b5b21d929cff7633f9d56893e7a9899b6d2b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870666f782f636f6e7461696e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfox/container)[![GitHub](https://camo.githubusercontent.com/348fd3d3044f7d6ecc189985cfe7787c09fcf4f336bda770450e45826aa61f54/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068702d666f782f636f6e7461696e6572)](https://camo.githubusercontent.com/348fd3d3044f7d6ecc189985cfe7787c09fcf4f336bda770450e45826aa61f54/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068702d666f782f636f6e7461696e6572)

This is the repository for the DI Container used in the PHP-Fox framework.

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

[](#installation)

You should not need to install this package when using the PHP-Fox framework, however if you wish to use this outside of the framework please use:

```
composer require phpfox/container
```

Usage
-----

[](#usage)

To use the container, all you need to do is:

```
$container = Container::getInstance();

$container->bind(
    abstract: Abstract::class,
    concrete: Concrete::class,
    shared: false, // defaults to false - true turns this into a singleton.
);

/**
 * @var bool
 */
$exists = $container->has(
    id: Abstract::class,
);

/**
 * @var Concrete
 */
$concrete = $container->make(
    abstract: Abstract::class,
);
```

Container implementation inspired by [example repo](https://github.com/jessarcher/service-container-from-scratch) from [Jess Archer](https://github.com/jessarcher), which provides a great and simple base.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~114 days

Total

3

Last Release

1615d ago

### Community

Maintainers

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

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (15 commits)")[![chapterjason](https://avatars.githubusercontent.com/u/1337562?v=4)](https://github.com/chapterjason "chapterjason (5 commits)")

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[bref/bref

Bref is a framework to write and deploy serverless PHP applications on AWS Lambda.

3.4k10.6M67](/packages/bref-bref)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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