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

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

chubbyphp/chubbyphp-container
=============================

A simple PSR-11 container implementation.

2.5.0(3mo ago)1978.4k—7.8%114MITPHPPHP ^8.3CI passing

Since Nov 26Pushed 3mo ago1 watchersCompare

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

READMEChangelogDependencies (9)Versions (19)Used By (14)

chubbyphp-container
===================

[](#chubbyphp-container)

[![CI](https://github.com/chubbyphp/chubbyphp-container/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-container/actions/workflows/ci.yml)[![Coverage Status](https://camo.githubusercontent.com/1817631389c61b145e99bcdf18191cead496b3e9ce11e35ed3085da43a69fda3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6368756262797068702f6368756262797068702d636f6e7461696e65722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/chubbyphp/chubbyphp-container?branch=master)[![Mutation testing badge](https://camo.githubusercontent.com/c4735c7aea3a9acef86e8d6b52b44e929e11100641e6aeda8dbbaf2c8c68ed59/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466368756262797068702532466368756262797068702d636f6e7461696e65722532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-container/master)[![Latest Stable Version](https://camo.githubusercontent.com/33cc4f9aaabb1ba572d0a42c97d177234d195ae9a0b4b4e29e971676be142f45/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d636f6e7461696e65722f76)](https://packagist.org/packages/chubbyphp/chubbyphp-container)[![Total Downloads](https://camo.githubusercontent.com/3c93d77115108fafa9b37b539dd9ded72f9f44d85911dba1cff34d2faa818b0f/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d636f6e7461696e65722f646f776e6c6f616473)](https://packagist.org/packages/chubbyphp/chubbyphp-container)[![Monthly Downloads](https://camo.githubusercontent.com/ace41b82d62d38ec536ded15542ab6fa20f43cf4d9372e85194b3cd2c8af29a7/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d636f6e7461696e65722f642f6d6f6e74686c79)](https://packagist.org/packages/chubbyphp/chubbyphp-container)

[![bugs](https://camo.githubusercontent.com/aa2d6d4f64b1269e8c975d61377ea5ca3b9e653b86bf7d07921cc2247ba97f08/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d62756773)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![code_smells](https://camo.githubusercontent.com/15f9956544fbae40cf80150e09da7c79b907b5fa1050c4857bb280e5e5c2e612/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![coverage](https://camo.githubusercontent.com/d00e669932bc5080481661ebf8b84a5809e870eef8a6fd5039fe5cfd25019b84/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![duplicated_lines_density](https://camo.githubusercontent.com/8f9b2d9c5df3bba55569414efe7e48be639b9e82a053fa37e176cc5eea416a45/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![ncloc](https://camo.githubusercontent.com/3686c36bc1b5953cd73757d4455619d05b558601d54c40303ea6d994d44ed65c/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d6e636c6f63)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![sqale_rating](https://camo.githubusercontent.com/e14d56fb997c2283b1fc3780f82b19b4b17dd2528cf0657495f25622701aaeb6/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![alert_status](https://camo.githubusercontent.com/879f501d395b866ae23886c4e8ff14b396b3594ce1ec07acc3ec820d13bb4677/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![reliability_rating](https://camo.githubusercontent.com/e696dadc4f22c34a82b65e086d27a0faa4c7b66c269641dd1f5d37bba340c4a8/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![security_rating](https://camo.githubusercontent.com/785ff6288dd3e39adbd841cf0684d43a6130d80e5655ddc43946dd1879d4fa6c/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![sqale_index](https://camo.githubusercontent.com/663a00c4ba6ca1e8eb657d651eae973f415b6ea44e688ae6798b7f3541cf287f/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)[![vulnerabilities](https://camo.githubusercontent.com/5fb73fadec859a19766708d76f8ac0ea7ca29cc7f6781d17700af136fb5e9326/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d636f6e7461696e6572266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-container)

Description
-----------

[](#description)

A minimal Dependency Injection Container (DIC) which implements PSR-11. [DI Container Benchmark](https://kocsismate.github.io/php-di-container-benchmarks/benchmark.html).

There is a laminas service manager adapter at [chubbyphp/chubbyphp-laminas-config](https://github.com/chubbyphp/chubbyphp-laminas-config).

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

[](#requirements)

- php: ^8.3
- [psr/container](https://packagist.org/packages/psr/container): ^2.0.2

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

[](#installation)

Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-container](https://packagist.org/packages/chubbyphp/chubbyphp-container).

```
composer require chubbyphp/chubbyphp-container "^2.5"
```

Usage
-----

[](#usage)

There are two PSR-11 implementations:

- `Chubbyphp\Container\Container` prototype (each get will return a new instance) and shared services
- `Chubbyphp\Container\MinimalContainer` shared services

### MinimalContainer / Container

[](#minimalcontainer--container)

#### Factories

[](#factories)

```
