PHPackages                             chimera/di-symfony - 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. chimera/di-symfony

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

chimera/di-symfony
==================

A set of compiler passes that connects all components together

0.4.0(5y ago)064.4k↓38.2%2[9 PRs](https://github.com/chimeraphp/di-symfony/pulls)MITPHPPHP ^7.4 || ^8.0

Since Feb 22Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/chimeraphp/di-symfony)[ Packagist](https://packagist.org/packages/chimera/di-symfony)[ GitHub Sponsors](https://github.com/lcobucci)[ Patreon](https://www.patreon.com/lcobucci)[ RSS](/packages/chimera-di-symfony/feed)WikiDiscussions 1.0.x Synced 1mo ago

READMEChangelog (6)Dependencies (16)Versions (21)Used By (0)

Chimera - DI Symfony
====================

[](#chimera---di-symfony)

[![Total Downloads](https://camo.githubusercontent.com/38ce30bdd6d6fbaa4e2215056e4d7e024684b3ce5a601a7dbc3092f206a90e66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368696d6572612f64692d73796d666f6e792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chimera/di-symfony)[![Latest Stable Version](https://camo.githubusercontent.com/d37136d04fd244121f8a612095dabe6f4b124e9365da0087dc2d0705e56f4cd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696d6572612f64692d73796d666f6e792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chimera/di-symfony)[![Unstable Version](https://camo.githubusercontent.com/9e719d940dea29407145731abaa14e8ed3b7bc209c99c3c7b35c52cb025fe6a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6368696d6572612f64692d73796d666f6e792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chimera/di-symfony)

[![Build Status](https://camo.githubusercontent.com/f761381adb97f3d8c1ecebb019afda61326574ef5d45c863240f50b5724be807/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6368696d6572617068702f64692d73796d666f6e792f504850556e697425323074657374732f302e352e783f7374796c653d666c61742d737175617265)](https://github.com/chimeraphp/di-symfony/actions?query=workflow%3A%22PHPUnit%20Tests%22+branch%3A0.5.x)[![Code Coverage](https://camo.githubusercontent.com/93d873856038901180fa4515a2f72760f5feeb2fe583608cbc24282927c0c264/68747470733a2f2f636f6465636f762e696f2f67682f6368696d6572617068702f64692d73796d666f6e792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/chimeraphp/di-symfony)

> The term Chimera (*/kɪˈmɪərə/* or */kaɪˈmɪərə/*) has come to describe any mythical or fictional animal with parts taken from various animals, or to describe anything composed of very disparate parts, or perceived as wildly imaginative, implausible, or dazzling.

There are many many amazing libraries in the PHP community and with the creation and adoption of the PSRs we don't necessarily need to rely on full stack frameworks to create a complex and well designed software. Choosing which components to use and plugging them together can sometimes be a little challenging.

The goal of this set of packages is to make it easier to do that (without compromising the quality), allowing you to focus on the behaviour of your software.

This package provides creates the configuration of the dependency injection container based on the packages you have required in your application. By relying on `symfony/dependency-injection` we put the complexity of wiring the components together in compilation time (instead of runtime).

There's a lot of hidden complexity in this wiring process, which definitely affects the organisation of the compiler passes, but the reason for that is to ensure that only things related to your software gets executed when handling requests.

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

[](#installation)

Package is available on [Packagist](http://packagist.org/packages/chimera/di-symfony), you can install it using [Composer](http://getcomposer.org).

```
composer require chimera/di-symfony
```

### PHP Configuration

[](#php-configuration)

In order to make sure that we're dealing with the correct data, we're using `assert()`, which is a very interesting feature in PHP but not often used. The nice thing about `assert()` is that we can (and should) disable it in production mode so that we don't have useless statements.

So, for production mode, we recommend you to set `zend.assertions` to `-1` in your `php.ini`. For development you should leave `zend.assertions` as `1` and set `assert.exception` to `1`, which will make PHP throw an [`AssertionError`](https://secure.php.net/manual/en/class.assertionerror.php)when things go wrong.

Check the documentation for more information:

Usage
-----

[](#usage)

Symfony DI component is just amazing, and it has everything we need to compile the container and just load it from a set of generated files, but the control of when to update those files now lies in the Kernel/MicroKernel. However we don't necessarily need to have a Kernel controlling that, we can use [`lcobucci/di-builder`](http://packagist.org/packages/lcobucci/di-builder)and simply get a Symfony DI container. That's what this package uses under the hood to create the services.

License
-------

[](#license)

MIT, see [LICENSE](LICENSE).

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance55

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~208 days

Recently: every ~385 days

Total

9

Last Release

978d ago

Major Versions

0.4.x-dev → 1.0.x-dev2023-09-13

PHP version history (4 changes)0.1.0PHP ^7.2 || ^8.0

0.3.0PHP ^7.3 || 8.0

0.4.0PHP ^7.4 || ^8.0

1.0.x-devPHP ~8.1.0 || ~8.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/201963?v=4)[Luís Cobucci](/maintainers/lcobucci)[@lcobucci](https://github.com/lcobucci)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (499 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (413 commits)")[![lcobucci](https://avatars.githubusercontent.com/u/201963?v=4)](https://github.com/lcobucci "lcobucci (256 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (66 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (7 commits)")[![rodrigorigotti](https://avatars.githubusercontent.com/u/387664?v=4)](https://github.com/rodrigorigotti "rodrigorigotti (1 commits)")[![dsantang](https://avatars.githubusercontent.com/u/6401532?v=4)](https://github.com/dsantang "dsantang (1 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")

---

Tags

hacktoberfest

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/chimera-di-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/chimera-di-symfony/health.svg)](https://phpackages.com/packages/chimera-di-symfony)
```

###  Alternatives

[kodicms/module-loader

1614.9k11](/packages/kodicms-module-loader)

PHPackages © 2026

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