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

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

iquxbyte/container-di
=====================

Simple IoC container with some method: bind, singleton, resolve, make.

0.0.1(6y ago)16MITPHPPHP ^7.1

Since Apr 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/iquxbyte/container-di)[ Packagist](https://packagist.org/packages/iquxbyte/container-di)[ RSS](/packages/iquxbyte-container-di/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

ContainerDI
===========

[](#containerdi)

Simple IoC container with some method: bind, singleton, resolve, make.

Install
-------

[](#install)

### Install Composer

[](#install-composer)

```
composer require iquxbyte/container-di
```

### Install Non-Composer

[](#install-non-composer)

Just download this repo and include `path/to/src/__autoload.php`.

Use
---

[](#use)

### Bind

[](#bind)

```
ContainerDI::bind(Foo::class);
```

### Singleton

[](#singleton)

```
ContainerDI::singleton(FooBarContract::class, FooBar::class);
```

### Make class

[](#make-class)

```
ContainerDI::make(FooBarContract::class, FooBar::class);
```

### Resolve class

[](#resolve-class)

```
ContainerDI::make(Foo::class);
```

Example
-------

[](#example)

```
