PHPackages                             peroxide/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. [Framework](/categories/framework)
4. /
5. peroxide/container

ActiveLibrary[Framework](/categories/framework)

peroxide/container
==================

Peroxide Container, a simple factory-driven PSR-11 Dependency Injection Container with zero dependencies and low functionalities.

v1.2.3(5mo ago)2552511MITPHPPHP ^8.2

Since Sep 16Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/Peroxide-PHP/peroxide-container)[ Packagist](https://packagist.org/packages/peroxide/container)[ RSS](/packages/peroxide-container/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (6)Dependencies (3)Versions (12)Used By (1)

[eng](README.md) / [pt-br](README_PT.md)

Peroxide/Container
==================

[](#peroxidecontainer)

A straightforward Dependency Injection container, designed for use with APIs, adhering to the PSR-11 standard. It boasts minimal functionality and operates independently, free from external dependencies.

Our filosophy
-------------

[](#our-filosophy)

We are passionate about working with components that are as clean and simple as possible. **Peroxide\\Container** is a fusion of inspiration drawn from libraries such as *Laminas\\ServiceManager*, *Pimple*, and with a touch of *PHP-DI*.

The great advantage is that we have no external dependencies. All configuration is achieved through PHP code using array configuration files. All you need to do is ensure that your framework supports PSR-11, set up the configuration, and you're ready to begin your coding journey.

How to use it
-------------

[](#how-to-use-it)

### Instaling

[](#instaling)

```
composer require peroxide/container
```

---

Starting your journey
---------------------

[](#starting-your-journey)

**Peroxide\\Container** is fully compliant with PSR-11, and it provides the following methods:

```
# From PSR-11
public function get(string $id): object;
public function has(string $id): bool;

# From our interface SetDependency
public function set(string $id, callable $factory): void;
public function setInvokableClass(string $id, string $invocableClass): void;
```

### Create your configuration as *array*

[](#create-your-configuration-as-array)

```
