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

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

agussuroyo/container
====================

Simple dependency injection container

1.0.0(7mo ago)00MITPHPPHP ^7.4 || ^8.0CI passing

Since Nov 13Pushed 7mo agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Dependency Injection Container
==============================

[](#dependency-injection-container)

A simple dependency injection container for PHP 7.4+.

[![PHP Version](https://camo.githubusercontent.com/ce0c70c519047d0e507604f03e6e8ae6c27bcc072027e899680d9bf93804dc76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

Overview
--------

[](#overview)

This is a lightweight dependency injection (DI) container. It provides automatic dependency resolution, interface binding, and singleton management.

### Key Features

[](#key-features)

- **Auto-wiring**: Automatically resolves constructor dependencies
- **Interface Binding**: Bind interfaces to concrete implementations
- **Singleton Support**: Manage singleton instances with automatic caching and clearing
- **Zero Configuration**: Works out of the box with no setup
- **Type-Safe**: Full type hints and generics support
- **Thoroughly Tested**: Comprehensive unit tests across PHP 7.4-8.4

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

[](#installation)

Install via Composer:

```
composer require agussuroyo/container
```

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- No additional dependencies

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

[](#quick-start)

```
