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

ActiveLibrary

thiagocordeiro/tiny-container
=============================

PHP tiny container for serverless like projects

v0.3.2(3y ago)11201[1 PRs](https://github.com/thiagocordeiro/tiny-container/pulls)MITPHPPHP ^8.1

Since Jun 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/thiagocordeiro/tiny-container)[ Packagist](https://packagist.org/packages/thiagocordeiro/tiny-container)[ RSS](/packages/thiagocordeiro-tiny-container/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Tiny Container
==============

[](#tiny-container)

Tiny container is a `psr/container` implementation which allows registering services to be instantiated only when needed, there is no fancy or complex features, for this I would recommend using . The goal is to have container capabilities under psr interface for very tiny projects, when we don't even need a framework.

Installing
----------

[](#installing)

```
composer require thiagocordeiro/tiny-container
```

How to use
----------

[](#how-to-use)

There is not much secret in using this tool.

```
$config = [
    UserRepositoryInterface::class => fn(ContainerInterface $container) => new DoctrineUserRepository(),
    CacheInterface::class => fn(ContainerInterface $container) => new RedisCache(),
    'http.api-client' => fn(ContainerInterface $container) => new GuzzleClient([]),
    MyService::class => fn(ContainerInterface $container) => new MyService(
        $container->get(UserRepositoryInterface::class),
        $container->get(CacheInterface::class),
        $container->get('http.api-client'),
    ),
];

$container = \TinyContainer\TinyContainer($config);

$service = $container->get(MyService::class);
$service->doTheThing();
```

Testing
-------

[](#testing)

```
composer run tests
```

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

[](#contributing)

Feel free to open issues and submit PRs

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~182 days

Recently: every ~199 days

Total

6

Last Release

1231d ago

PHP version history (2 changes)v0.1PHP ^7.4 || ^8.0

v0.3.1PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![thiagocordeiro](https://avatars.githubusercontent.com/u/1073649?v=4)](https://github.com/thiagocordeiro "thiagocordeiro (8 commits)")[![JulianaSaran](https://avatars.githubusercontent.com/u/118539731?v=4)](https://github.com/JulianaSaran "JulianaSaran (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

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

Flow Application Framework

862.0M451](/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)
