PHPackages                             life-style-coding/container-pattern - 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. life-style-coding/container-pattern

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

life-style-coding/container-pattern
===================================

Small library of dependency inversion with container

1.1.1(3y ago)027[1 issues](https://github.com/niko-38500/container-pattern-php/issues)MITPHPPHP &gt;=8.0

Since Jun 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/niko-38500/container-pattern-php)[ Packagist](https://packagist.org/packages/life-style-coding/container-pattern)[ Docs](https://github.com/niko-38500/container-pattern-php.git)[ RSS](/packages/life-style-coding-container-pattern/feed)WikiDiscussions main Synced 1w ago

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

Welcome to container-pattern-php 👋
==================================

[](#welcome-to-container-pattern-php-)

 [![Version](https://camo.githubusercontent.com/7b14e943ef9b21021297e68c133c7aa7abeb5a788840b711d4cb539858503edc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e7376673f63616368655365636f6e64733d32353932303030)](https://camo.githubusercontent.com/7b14e943ef9b21021297e68c133c7aa7abeb5a788840b711d4cb539858503edc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e7376673f63616368655365636f6e64733d32353932303030) [ ![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667) ](#)

> ⚠️ Huge refacto in progresse the doc is no longer up to date so usage section is not working anymore

### 🏠 [Homepage](https://github.com/niko-38500/container-pattern-php.git)

[](#-homepage)

Install
-------

[](#install)

```
composer require life-style-coding/container-pattern
```

Usage
-----

[](#usage)

step 1: To use it you have to provide the use statement for the package at your index.php

```
use LifeStyleCoding\Container\Container;
```

step 2: Instanciate the container class

step 3: run the resolve method of the container into a instance variable and pass the class name as argument

step 4: run the execute method of the container and pass the instance variable and the class methods you wish to call as arguments

exemple :

```
$class = "\\App\\Controller\\HomeController";
$method = "index";
$container = new Container();
$instance = $container->resolve($class);
$container->execute($instance, $method);
```

Next update
-----------

[](#next-update)

Adding a list of objects already instantiated, so as not to have to reinstate them

Handle routing with block comments

Author
------

[](#author)

👤 **Nicolas Montmayeur**

- Github: [@niko-38500](https://github.com/niko-38500)
- LinkedIn: [@nicolas-montmayeur-9b7b441ab](https://linkedin.com/in/nicolas-montmayeur-9b7b441ab)

Show your support
-----------------

[](#show-your-support)

Give a ⭐️ if this project helped you!

---

*This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)*

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~293 days

Total

3

Last Release

1221d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.1.1PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/65814950?v=4)[niko-38500](/maintainers/niko-38500)[@niko-38500](https://github.com/niko-38500)

---

Top Contributors

[![niko-38500](https://avatars.githubusercontent.com/u/65814950?v=4)](https://github.com/niko-38500 "niko-38500 (12 commits)")

---

Tags

phpdependencies injection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/life-style-coding-container-pattern/health.svg)

```
[![Health](https://phpackages.com/badges/life-style-coding-container-pattern/health.svg)](https://phpackages.com/packages/life-style-coding-container-pattern)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
