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

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

seeren/container
================

Autowire and configure dependencies

3.0.1(3y ago)23022MITPHPPHP &gt;=8.0.1

Since Oct 14Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (15)Used By (2)

Seeren\\Container
=================

[](#seerencontainer)

[![Build](https://camo.githubusercontent.com/8ad8681b1597bb67b7bb59add95f0afb46c60d1a3bf7a2a2ac268bafbf82b45b/68747470733a2f2f6170702e7472617669732d63692e636f6d2f73656572656e2f687474702e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/seeren/container)[![Require](https://camo.githubusercontent.com/382a748388955916534ce2f2990eaff9ad5daa6ac705ffd31a739a366c804402/68747470733a2f2f706f7365722e707567782e6f72672f73656572656e2f636f6e7461696e65722f726571756972652f706870)](https://packagist.org/packages/seeren/container)[![Coverage](https://camo.githubusercontent.com/438dfa164d3a12185bed1c66cbbc900624e08718628934798dc58aa86a130814/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73656572656e2f6572726f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/seeren/container?branch=master)[![Download](https://camo.githubusercontent.com/fb78941b79e38e8300897b0547af090e157290d092ff3e2a5c4ae0a3feebe266/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656572656e2f636f6e7461696e65722e737667)](https://packagist.org/packages/seeren/container/stats)[![Codacy Badge](https://camo.githubusercontent.com/af52a013c8dd784c3df9acfe7776770b99d836a997bcbc3419a77bbb6a12310e/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6338646261373433316336653462656262623935363338376663383237623064)](https://www.codacy.com/gh/seeren/container/dashboard?utm_source=github.com&utm_medium=referral&utm_content=seeren/container&utm_campaign=Badge_Grade)[![Version](https://camo.githubusercontent.com/21b10f19e2c5adaa0f8c306175f2fa48fa08a784d3ab745b72a74d0ce137c022/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656572656e2f636f6e7461696e65722e737667)](https://packagist.org/packages/seeren/container)

Autowire and configure dependencies

---

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

[](#installation)

Seeren\\Container is a [PSR-11 container interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md) implementation

```
composer require seeren/container
```

---

Seeren\\Container\\Container
----------------------------

[](#seerencontainercontainer)

The container create, build, store and share instances

```
use Seeren\Container\Container;

$container = new Container();

$foo = $container->get('Dummy\Foo');
```

### Autowiring

[](#autowiring)

Dependencies are resolved using type declaration

```
namespace Dummy;

class Foo
{
    public function __construct(Bar $bar){}
}

class Bar
{
    public function __construct(Baz $baz){}
}

class Baz {}
```

### Interfaces

[](#interfaces)

```
namespace Dummy;

class Foo {
    public function __construct(BarInterface $bar){}
}
```

Interfaces are resolved using configuration file by default in `/config/services.json`

```
{
  "parameters": {},
  "services": {
    "Dummy\\Foo": {
      "Dummy\\BarInterface": "Dummy\\Bar"
    }
  }
}
```

Include path can be specified at construction

```
project/
└─ config/
   └─ services.json
```

### Parameters

[](#parameters)

Parameters and primitives are resolved using configuration file

```
namespace Dummy;

class Foo
{
    public function __construct(string $bar){}
}
```

```
{
  "parameters": {
    "message": "Hello"
  },
  "services": {
    "Dummy\\Foo": {
      "bar": ":message"
    }
  }
}
```

### Methods

[](#methods)

Methods can use autowiring

```
namespace Dummy;

class Foo
{

    public function __construct(BarInterface $bar){}

    public function action(int $id, Baz $baz)
    {
        return 'Hello';
    }

}
```

```
use Seeren\Container\Container;

$container = new Container();

$message = $container->call('Dummy\Foo', 'action', [7]);

echo $message; // Hello
```

---

License
-------

[](#license)

This project is licensed under the [MIT](./LICENSE) License

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~159 days

Recently: every ~154 days

Total

14

Last Release

1422d ago

Major Versions

v1.4.2 → 2.02020-10-13

2.2 → 3.0.02022-01-07

PHP version history (4 changes)v1.0.1PHP &gt;=7.0.1

v1.4PHP &gt;=7.2.0

2.0PHP &gt;=7.4.0

3.0.0PHP &gt;=8.0.1

### Community

Maintainers

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

---

Top Contributors

[![seeren](https://avatars.githubusercontent.com/u/17710028?v=4)](https://github.com/seeren "seeren (161 commits)")

---

Tags

autowiringpsr-11servicePSR-11Autowiringservice

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[devanych/di-container

Simple implementation of a PSR-11 dependency injection container

124.2k3](/packages/devanych-di-container)

PHPackages © 2026

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