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

ActiveLibrary

logifire/nano-container
=======================

PSR-11 container

2.0.3(4y ago)0412MITPHPPHP &gt;=7.0.0

Since May 20Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (17)Used By (2)

nano-container
==============

[](#nano-container)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9f8879637ade3e23cd51144bcdc45b8a35ccadf901a32d6b5c22a3c82109d283/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c6f6769666972652f6e616976652d636f6e7461696e65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Logifire/naive-container/?branch=master)[![Build Status](https://camo.githubusercontent.com/70d738b87028328c2ebfcc147f037de51122f4d7ec68550b41bf5241d3cc85e1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c6f6769666972652f6e616976652d636f6e7461696e65722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Logifire/naive-container/build-status/master)

A [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md) container implementation

Usage
-----

[](#usage)

**Basics**

```
$factory = new ContainerFactory();

$factory->set('my_value', 42);

$factory->register('my_service', function(Container $c) {
    return 100 + $c->get('my_value');
});

$container = $factory->createContainer();

echo $container->get('my_value'); // 42

echo $container->get('my_service'); // 142

```

**Grouping configurations**You can group configurations into providers, which takes a `ContainerFactory`

```
class ControllerProvider implements FactoryProvider {
    public function register(ContainerFactory $factory) {
        $factory->register(LoginController::class, function(Container $c) {
            return new LoginController();
        });
    }
}

$factory = new ContainerFactory();
$factory->addProvider(new ControllerProvider());
$container = $factory->createContainer();
$controller = $container->get(LoginController::class);

```

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

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 ~114 days

Recently: every ~243 days

Total

15

Last Release

1676d ago

Major Versions

0.7 → 1.0.02018-12-02

1.2.1 → 2.0.02019-03-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16954276?v=4)[Bo Andersen](/maintainers/Logifire)[@Logifire](https://github.com/Logifire)

---

Top Contributors

[![Logifire](https://avatars.githubusercontent.com/u/16954276?v=4)](https://github.com/Logifire "Logifire (36 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[neos/flow

Flow Application Framework

862.0M448](/packages/neos-flow)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/json-streamer

Provides powerful methods to read/write data structures from/into JSON streams.

14440.0k8](/packages/symfony-json-streamer)[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

632.3k](/packages/rubix-server)

PHPackages © 2026

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