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

ActiveLibrary

robert430404/rc-container
=========================

This is a simple Dependency Injection Container for PHP.

1.2.0(9y ago)112MITPHPPHP &gt;=7.0

Since Feb 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Robert430404/rc-container)[ Packagist](https://packagist.org/packages/robert430404/rc-container)[ RSS](/packages/robert430404-rc-container/feed)WikiDiscussions master Synced 1mo ago

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

[![Latest Stable Version](https://camo.githubusercontent.com/edfb8147b3fcb632188543270ddb35eca9d620c3729990394dbb85f7b3d36138/68747470733a2f2f706f7365722e707567782e6f72672f726f626572743433303430342f72632d636f6e7461696e65722f762f737461626c65)](https://packagist.org/packages/robert430404/rc-container)[![Build Status](https://camo.githubusercontent.com/f0db2e2b23bb1d36e2b6d0c72bce514bbc0b38b440916dd4b68291285855b3b7/68747470733a2f2f7472617669732d63692e6f72672f526f626572743433303430342f72632d636f6e7461696e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Robert430404/rc-container)[![codecov](https://camo.githubusercontent.com/e8c321bea22e55621dec68639d4af1e1bbc967e69ba971a347923524663f7779/68747470733a2f2f636f6465636f762e696f2f67682f526f626572743433303430342f72632d636f6e7461696e65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Robert430404/rc-container)

### What Is This?

[](#what-is-this)

This is RC Container. This is a simple dependency injection container that allows you to register services, parameters, and factories for your application and then retrieve/de-register them.

### Why Write This?

[](#why-write-this)

I did it to flex my brain, and get a full understanding of how DI-Containers work in the PHP space. Rather than just reading about it and assuming I knew what did what, I wrote this to solidify my knowledge.

### Installing The Package

[](#installing-the-package)

To install and use this package, install it with composer:

```
composer require robert430404/rc-container

```

### How Does It Work?

[](#how-does-it-work)

The container relies on composer for the autoloading of the classes. You then create a new instance of the Container() object and start assigning your services/parameters/factories to the instance.

```
