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

ActiveLibrary

leandrofull/service-container
=============================

Service Container

1.0.0(1y ago)02proprietaryPHP

Since Feb 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/leandrofull/service-container)[ Packagist](https://packagist.org/packages/leandrofull/service-container)[ Docs](https://github.com/leandrofull/task-manager)[ RSS](/packages/leandrofull-service-container/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Service Container
=================

[](#service-container)

- PHP 8.2
- Reflection API Extension

`composer require leandrofull/service-container`

php tests/run
-------------

[](#php-testsrun)

```
use LeandroFull\Test\Assert;
use LeandroFull\ServiceContainer\ServiceContainer;

interface UserRepository
{
}

class RealUserRepository implements UserRepository
{
}

abstract class Controller
{
    public function __construct(protected readonly UserRepository $userRepository) {}
}

class HomeController extends Controller
{
    public function index(UserRepository $userRepository): void
    {
        Assert::same(RealUserRepository::class, $userRepository::class);
    }
}

$container = new ServiceContainer();

$controller = $container->get(HomeController::class);

Assert::same(null, $controller);

$container->set(UserRepository::class, fn(): UserRepository => new RealUserRepository());

$controller = $container->get(HomeController::class);

Assert::same(HomeController::class, $controller::class);

$container->invoke($controller, 'index');
```

### Result:

[](#result)

```
Assertions: 3
Ok: 3

OK!

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance42

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

459d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21ddcf2de8acbbba13969b42af02d8212de63800c58e71b0769ccca39151f3e0?d=identicon)[leandrofull](/maintainers/leandrofull)

---

Top Contributors

[![leandrofull](https://avatars.githubusercontent.com/u/114156077?v=4)](https://github.com/leandrofull "leandrofull (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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