PHPackages                             stephanecoinon/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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. stephanecoinon/ioc-container

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

stephanecoinon/ioc-container
============================

Polymorphic IoC Container for PHP

v0.1(8y ago)07MITPHPPHP 7.\*

Since Aug 17Pushed 7y ago1 watchersCompare

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

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

Polymorphic IoC Container for PHP
=================================

[](#polymorphic-ioc-container-for-php)

[![Codeship Status for stephanecoinon/ioc-container](https://camo.githubusercontent.com/bbcbed627bf61b5ea465f3f8d16cc0c3eb3be6d9dee3fb4f65d45025fce86457/68747470733a2f2f6170702e636f6465736869702e636f6d2f70726f6a656374732f38313237306430302d363561652d303133352d646333382d3632333136336361353632662f7374617475733f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/bbcbed627bf61b5ea465f3f8d16cc0c3eb3be6d9dee3fb4f65d45025fce86457/68747470733a2f2f6170702e636f6465736869702e636f6d2f70726f6a656374732f38313237306430302d363561652d303133352d646333382d3632333136336361353632662f7374617475733f6272616e63683d6d6173746572)

Versatile IoC container package that wraps around the container of the framework it's pulled in.

When this package is pulled in a framework (ie Laravel, Symfony...), it automatically detects it and wraps around the native IoC container of the framework.

When used in a vanilla PHP context, this package uses the [PHP League container](http://container.thephpleague.com).

This is useful when developping an agnostic package that needs an IoC container but also ships with service providers for popular frameworks. It gives you a common IoC container API that leverages the framework native IoC container without your package ever pulling the framework itself.

Frameworks currently supported are:

- [Laravel](https://laravel.com)
- [Slim](https://www.slimframework.com)

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

[](#requirements)

- PHP 7

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

[](#installation)

```
composer require stephanecoinon/ioc-container

```

Usage
-----

[](#usage)

```
