PHPackages                             jeanmarcos/dependency-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jeanmarcos/dependency-container

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jeanmarcos/dependency-container
===============================

Dependency container

v1.0.0-alpha(1y ago)2106MITPHPPHP &gt;=8.3

Since Nov 11Pushed 1y ago1 watchersCompare

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

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

Jeanmarcos Dependency Container
===============================

[](#jeanmarcos-dependency-container)

[![Latest Version](https://camo.githubusercontent.com/d4c8dcefbee4eb4401332e1108c1278957123c9da63d2f5ad881fbb3d700930b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d76312e302e302d2d616c7068612d626c75652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeanmarcos/dependency-container)[![Latest Version](https://camo.githubusercontent.com/9b62cff335cc6ab2a387ce57d8ed7b5b5387e430eb4a38968e2f9fba45f64171/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65616e6d6172636f732f646570656e64656e63792d636f6e7461696e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeanmarcos/dependency-container)[![Build Status](https://camo.githubusercontent.com/35d68cddf1452ddefdf2212630de6425f04a4da7d00f7a7a89ed5317146412eb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a65616e6d6172636f732f646570656e64656e63792d636f6e7461696e65722f746573742e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/jeanmarcos-dev/dependency-container/actions)[![License](https://camo.githubusercontent.com/b7c4c147d530d603b7ec1e2f6867b6eb82612bbbb965cbf1cb788e00f014ac2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a65616e6d6172636f732f646570656e64656e63792d636f6e7461696e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeanmarcos/dependency-container)

> ⚠️ **Note**: This is an alpha version and is not ready for production use. Upcoming releases will include new features and improvements.

A lightweight, PSR-4 compatible Dependency Injection (DI) container for managing dependencies in PHP applications.

📜 Overview
----------

[](#-overview)

`jeanmarcos/dependency-container` is a flexible and simple-to-use dependency injection container designed to help you manage your services and dependencies in PHP projects. The project is inspired by the DI container of Magento, aiming to offer similar extensibility and flexibility..

✨ Features
----------

[](#-features)

- PSR-4 autoloading compatibility.
- Auto-wiring capabilities.
- Support for shared (singleton) and non-shared instances.
- Circular dependency detection.
- Flexible configuration for optional and nullable dependencies.
- Singleton container implementation.
- **Upcoming**: Interceptors to extend and modify class behaviors dynamically.

🛠️ Installation
---------------

[](#️-installation)

Install the package via [Composer](https://getcomposer.org/):

```
composer require jeanmarcos/dependency-container
```

⚡ Quick Start
-------------

[](#-quick-start)

### Instantiating with Services in the Constructor

[](#instantiating-with-services-in-the-constructor)

You can directly instantiate the container with services provided as configurations:

```
