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

ActiveLibrary

hixman/psr-container
====================

A psr-11 container implementation

110PHP

Since Jul 27Pushed 8y agoCompare

[ Source](https://github.com/HIXMAN/psr-container)[ Packagist](https://packagist.org/packages/hixman/psr-container)[ RSS](/packages/hixman-psr-container/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

psr-container
=============

[](#psr-container)

[![Latest Version on Packagist](https://camo.githubusercontent.com/636ec9c8b4e8b87d074c3b7eb73257144a33a88089b9cc432952c68301e74fa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6869786d616e2f7073722d636f6e7461696e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hixman/psr-container)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/1b74987da05ec94227e8eae7a61a70b132ab53a6fd44bebaac11563ff1c8857a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6869786d616e2f7073722d636f6e7461696e65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/hixman/psr-container)[![Total Downloads](https://camo.githubusercontent.com/f56459ad038788a72cf65b440439e0779a0bb288e9957ffca832e5e487158274/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6869786d616e2f7073722d636f6e7461696e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hixman/psr-container)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Install
-------

[](#install)

Via Composer

```
$ composer require hixman/psr-container
```

Usage
-----

[](#usage)

**Basic Usage**

```
$container =  new Container();
$container->set(UserRepository::class, function(){
    return new UserRepository();
});
$userRepositoryExits = $container->has(UserRepository::class;
$userRepository = $container->get(UserRepository::class);
```

**Delegated Repository**

Only delegated container lookup.

```
$container =  new Container();
$delegatedContainer = new Container();
$container->setDelegatedContainer($delegatedContainer);
$container->set(UserRepository::class, function(){
    return new UserRepository();
});
$userRepositoryExits = $container->has(UserRepository::class; // False
$userRepository = $container->get(UserRepository::class); // Throws NotFoundException
```

Delegated container and itself lookup

```
$container =  new Container();
$delegatedContainer = new Container();
$container->setDelegatedContainer($delegatedContainer, DelegableInterface::NOT_ONLY_DELEGATED);
$container->set(UserRepository::class, function(){
    return new UserRepository();
});
$userRepositoryExits = $container->has(UserRepository::class; // True
$userRepository = $container->get(UserRepository::class); // A new instance of UserRepository
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Hixman](https://github.com/Hixman)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

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

---

Top Contributors

[![HIXMAN](https://avatars.githubusercontent.com/u/1638531?v=4)](https://github.com/HIXMAN "HIXMAN (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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