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

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

orakaro/ioc
===========

Tiny IoC module for static mocking in PHP

v1.0.0(12y ago)054MITPHPPHP &gt;=5.3.0

Since Apr 12Pushed 12y agoCompare

[ Source](https://github.com/DTVD/IoC)[ Packagist](https://packagist.org/packages/orakaro/ioc)[ Docs](https://github.com/DTVD/IoC)[ RSS](/packages/orakaro-ioc/feed)WikiDiscussions master Synced 2w ago

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

\###Inversion Of Control
[![Build Status](https://camo.githubusercontent.com/b8f57ea0b5fd9d5fc04e7f860eebe72b685074a70a61304e1bcf0fc9c6c7ba80/68747470733a2f2f7472617669732d63692e6f72672f445456442f496f432e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DTVD/IoC)[![Total Downloads](https://camo.githubusercontent.com/3ce8c1af0c58f1fbc10b330f9e057d009e1de908e3e14a5226cd9f9cfc280599/68747470733a2f2f706f7365722e707567782e6f72672f6f72616b61726f2f696f632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/orakaro/ioc)[![License](https://camo.githubusercontent.com/2be45a85e76279be97a358582e7c1b86107c29a34ebdb9679cc8b1e253e36426/68747470733a2f2f706f7365722e707567782e6f72672f6f72616b61726f2f696f632f6c6963656e73652e706e67)](https://packagist.org/packages/orakaro/ioc)

*"Don't call me let me call you"*

- Have you ever heard about Inversion Of Control / Dependency Injection in PHP ?
- Know some giants like [Symfony Service Container](http://symfony.com/doc/current/book/service_container.html) or [Laravel Facades ](http://laravel.com/docs/facades) ?
- Wishing you could use Inversion Of Control (IoC) and Facade Design Pattern in your legacy source code ?

I think I can help you a little bit ! Let's start :)

\###Quick Start

This tiny packge will provide an easy and lightweight way to implement IoC

- Include following lines in your `composer.json`

```
    "require": {
        "orakaro/ioc": "dev-master"
    }
```

- Get classes autoloaded

```
composer dump-autoload
```

- Done ! Now head over Usage section !

\###Usage

Let me assume that you have some class like

```
