PHPackages                             composite-php/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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. composite-php/container

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

composite-php/container
=======================

A PSR-11 implementation with auto-wiring.

1.2.2(2y ago)21511MITPHP

Since Apr 4Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (6)Used By (0)

DI container
============

[](#di-container)

Yet another implementation of [PSR-11](https://www.php-fig.org/psr/psr-11/) with support of automatic constructor injection. Requires PHP `8.1` or higher.

Features
--------

[](#features)

- Implements [PSR-11](http://www.php-fig.org/psr/psr-11/).
- Supports automatic constructor injection ((via `Reflection`).
- Detects cyclic dependencies.

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

[](#installation)

Install with composer:

```
composer require composite-php/container
```

Usage
-----

[](#usage)

### Automatic resolution

[](#automatic-resolution)

The container can do constructor injection automatically. Assume you have the following classes in your project:

```
