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

ActiveLibrary

bonzer/ioc-container
====================

Inversion of Control Container - facilitating Interface Oriented Design

v0.0.2(2y ago)0561MITPHPPHP &gt;=5.4.0

Since Apr 14Pushed 2y agoCompare

[ Source](https://github.com/parasralhan/ioc-container)[ Packagist](https://packagist.org/packages/bonzer/ioc-container)[ RSS](/packages/bonzer-ioc-container/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (3)Used By (1)

IOC Container -- Inversion of Control Container
===============================================

[](#ioc-container----inversion-of-control-container)

Facilitating Interface Oriented Design

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

- PHP &gt;= 5.4
- "bonzer/exceptions" : "dev-master"

### Installing

[](#installing)

It can be installed via composer. Run

```
composer require bonzer/ioc-container

```

Usage
-----

[](#usage)

```
use Bonzer\IOC_Container\facades\Container as App_Container;

```

### Binding to Container

[](#binding-to-container)

There are two methods available:
`bind` or `singleton` for binding your class with container.
used as:

```
App_Container::bind('My_Class', 'My\Namespace\My_Class');
App_Container::singleton('My_Class', 'My\Namespace\My_Class');

```

#### Binding Interfaces:

[](#binding-interfaces)

You can also bind your interfaces with container as:

```
App_Container::bind('My\Namespace\My_Interface', 'My\Namespace\My_Class');

```

and whenever you use this interfaces in any other class and if that class is bound and/or instantiated via `IOC_Container`the interface will automatically gets resolved.

### Instantiating

[](#instantiating)

For instantiating, Just call `App_Container::make` with the bound key:

```
App_Container::make('My_Class');

```

- **Note**: If you have bound with `singleton`, `App_Container::make` will return the same instance everytime.

#### Direct Instantiation:

[](#direct-instantiation)

Direct Instantiation is also possible, without binding. For eg.

```
App_Container::make('My\Namespace\My_Class');

```

for singleton instantiation without binding, use:

```
App_Container::make_singleton('My\Namespace\My_Class');

```

- **Note**: If your class has private constructor, then `IOC_Container` checks for the availability of any of the two static methods: `init` or `get_instance`

Support
-------

[](#support)

If you are having issues, please let me know.
You can contact me at

License
-------

[](#license)

The project is licensed under the MIT license.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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 ~1975 days

Total

2

Last Release

976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64f6c4cc8c518c09b0899e69c50d9068b0470f667bbc827bbc1892b1e72aea99?d=identicon)[parasralhan](/maintainers/parasralhan)

---

Top Contributors

[![parasralhan](https://avatars.githubusercontent.com/u/37013182?v=4)](https://github.com/parasralhan "parasralhan (5 commits)")

### Embed Badge

![Health badge](/badges/bonzer-ioc-container/health.svg)

```
[![Health](https://phpackages.com/badges/bonzer-ioc-container/health.svg)](https://phpackages.com/packages/bonzer-ioc-container)
```

PHPackages © 2026

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