PHPackages                             switon/di - 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. switon/di

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

switon/di
=========

Dependency injection container and autowiring for Switon Framework

v1.0.0(1mo ago)09310MITPHPPHP &gt;=8.3CI passing

Since May 9Pushed 1mo agoCompare

[ Source](https://github.com/switon-php/di)[ Packagist](https://packagist.org/packages/switon/di)[ Docs](https://github.com/switon-php/di)[ RSS](/packages/switon-di/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (10)

Switon DI Package
=================

[](#switon-di-package)

Dependency injection container and autowiring for Switon Framework.

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

[](#installation)

```
composer require switon/di
```

**Requirements:** PHP 8.3+, `ext-json`

Quick Start
-----------

[](#quick-start)

```
use Switon\Core\Attribute\Autowired;
use Switon\Di\Container;
use Switon\Di\ServiceProvider;

interface CacheInterface {}
class Cache implements CacheInterface {}

class ProductService
{
    #[Autowired] protected CacheInterface $cache;
}

$container = new Container();
(new ServiceProvider())->register($container);
$productService = $container->get(ProductService::class);
```

Docs:

License
-------

[](#license)

MIT.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

31d ago

### Community

Maintainers

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

---

Top Contributors

[![switon-php](https://avatars.githubusercontent.com/u/247358032?v=4)](https://github.com/switon-php "switon-php (3 commits)")

---

Tags

autowiredautowiringcontainerdependency-injectionswitoncontainerAutowiringdependency-injectionswiton

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/switon-di/health.svg)

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[pimple/pimple

Pimple, a simple Dependency Injection Container

2.8k133.2M1.4k](/packages/pimple-pimple)[aura/di

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

356982.2k60](/packages/aura-di)[testo/testo

A lightweight PHP testing framework.

1843.4k30](/packages/testo-testo)

PHPackages © 2026

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