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

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

cczzjj/di
=========

Simple Dependencies Container following PSR-11 standards, using php8 Attributes like Spring.

v0.0.4(3y ago)06MITPHPPHP &gt;=8.0

Since Dec 25Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (5)Used By (0)

Dependencies Container with PHP8 Attributes
-------------------------------------------

[](#dependencies-container-with-php8-attributes)

Simple Dependencies Container following PSR-11 standards, using php8 Attributes like Spring.

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

[](#installation)

```
$ composer require cczzjj/di
```

Usage
-----

[](#usage)

### Default behavior

[](#default-behavior)

```
$container = new DI\Container;

$instance = new stdClass;

$container->set('key', $instance);

$container->has('key'); // true

$object = $container->get('key');

echo $object === $instance . PHP_EOL; // true

class Student {
    public function __construct(private string $name) {}

    public  function getName(): string{
        return $this->name;
    }
}

/** @var Student $student */
$student = $container->make(Student::class, 'Jack');

echo $student->getName(); // Jack
```

### PHP8 Attributes

[](#php8-attributes)

```
class Entity1 {

    #[Autowired]
    private Entity2 $entity2;

    public  function getEntity2(): Entity2{
        return $this->entity2;
    }
}

class Entity2 {

    #[Autowired]
    private Entity1 $entity1;

    public  function getEntity1(): Entity1{
        return $this->entity1;
    }
}

$container = new DI\Container;

/** @var Entity1 $entity1 */
$entity1 = $container->get(Entity1::class);

/** @var Entity2 $entity2 */
$entity2 = $container->get(Entity2::class);

echo $entity1->getEntity2() === $entity2; // true
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Every ~7 days

Total

4

Last Release

1217d ago

### Community

Maintainers

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

---

Top Contributors

[![cczzjj](https://avatars.githubusercontent.com/u/33168408?v=4)](https://github.com/cczzjj "cczzjj (7 commits)")

---

Tags

containerPSR-11dependency-injectiondiiocpsr11attributes

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[slince/di

A flexible dependency injection container

20260.4k6](/packages/slince-di)

PHPackages © 2026

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