PHPackages                             elazar/auryn-container-interop - 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. elazar/auryn-container-interop

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

elazar/auryn-container-interop
==============================

PSR-11 Container compatibility for Auryn

3.0.0(8y ago)3154MIT

Since Jun 25Compare

[ Source](https://github.com/elazar/auryn-container-interop)[ Packagist](https://packagist.org/packages/elazar/auryn-container-interop)[ RSS](/packages/elazar-auryn-container-interop/feed)WikiDiscussions Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

auryn-container-interop
=======================

[](#auryn-container-interop)

[![Build Status](https://camo.githubusercontent.com/bf9910536071ac58ccf84e510fcd4b4f1a266b949a52af39d5964aae4fb5de26/68747470733a2f2f7472617669732d63692e6f72672f656c617a61722f617572796e2d636f6e7461696e65722d696e7465726f702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/elazar/auryn-container-interop)

[PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md) compatibility for [Auryn](https://github.com/rdlowrey/Auryn)

License
-------

[](#license)

This library is licensed under the [MIT License](https://opensource.org/licenses/MIT).

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

[](#installation)

Use [composer](https://getcomposer.org/).

```
composer require elazar/auryn-container-interop

```

Usage
-----

[](#usage)

```
use Elazar\Auryn\Container;
use Acme\SomeDependency;

$container = new Container;

if ($container->has(SomeDependency::class)) {
    // ...
}

$instance = $container->get(SomeDependency::class);

// All public methods of Auryn\Injector are available
$instance = $container->make(SomeDependency::class);
```

Be sure you are familiar with [how Auryn works](https://github.com/rdlowrey/Auryn#how-it-works). As recommended by its author, avoid using it as a [service locator](https://en.wikipedia.org/wiki/Service_locator_pattern).

Implementation
--------------

[](#implementation)

While I agree with a lot of the discussion in [this issue](https://github.com/rdlowrey/Auryn/issues/77)regarding why new projects can use Auryn directly without a *PSR-11*implementation, I do think that such an implementation can be useful for integrating Auryn with third-party libraries that use *PSR-11*, such as [zend-expressive](https://github.com/zendframework/zend-expressive).

The implementation in this repository takes a small amount of liberty with this passage from [Section 1.1.2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md#112-reading-from-a-container)of the *PSR-11* specification:

> `has` ... MUST return `true` if an entry identifier is known to the container

Auryn uses [fully qualified names](https://en.wikipedia.org/wiki/Fully_qualified_name)for classes and interfaces to identify dependencies where most container implementations use user-designated names. As such, it's possible for Auryn to instantiate a class even if it contains no definitions for that class (e.g. if the class has no required constructor parameters or if those parameters are themselves instantiable classes).

Because of this, `ContainerInterface->has()` in this *PSR-11*implementation will return `true` if either the underlying `Auryn\Injector`instance has definitions for a requested class or interface or if a requested class is defined and considered instantiable (i.e. is not `abstract` and has a `public` implementation of `__construct()`). While some may view this as technically incorrect, it seems consistent to me with the overall spirit and intentions of the *PSR-11* standard.

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

[](#development)

To run the PHPUnit test suite:

```
composer run-script test

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% 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 ~245 days

Total

4

Last Release

2922d ago

Major Versions

1.0.0 → 2.0.02016-07-02

2.1.0 → 3.0.02018-07-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/80dec604abed1b21daafc54c430468444a2ad163ad5f8229348b8d241b797778?d=identicon)[elazar](/maintainers/elazar)

---

Top Contributors

[![elazar](https://avatars.githubusercontent.com/u/15487?v=4)](https://github.com/elazar "elazar (13 commits)")[![harikt](https://avatars.githubusercontent.com/u/120454?v=4)](https://github.com/harikt "harikt (2 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (1 commits)")

---

Tags

PSR-11dependency-injectionauryn

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elazar-auryn-container-interop/health.svg)

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.9k55.5M1.2k](/packages/php-di-php-di)[laminas/laminas-servicemanager

Factory-Driven Dependency Injection Container

16058.7M789](/packages/laminas-laminas-servicemanager)[slince/di

A flexible dependency injection container

20268.4k6](/packages/slince-di)[phpwatch/simple-container

A fast and minimal PSR-11 compatible Dependency Injection Container with array-syntax and without auto-wiring

1811.1k2](/packages/phpwatch-simple-container)[infocyph/intermix

A lightweight PHP DI container, invoker, serializer, and utility toolkit.

137.3k1](/packages/infocyph-intermix)

PHPackages © 2026

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