PHPackages                             chacal/silex-di-builder - 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. chacal/silex-di-builder

ActiveLibrary

chacal/silex-di-builder
=======================

A simple dependency injection builder to Silex

040PHP

Since Mar 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/chacal88/silex-di-container-provider)[ Packagist](https://packagist.org/packages/chacal/silex-di-builder)[ RSS](/packages/chacal-silex-di-builder/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Silex DI Builder
================

[](#silex-di-builder)

[![Build Status](https://camo.githubusercontent.com/92e8e5491a985edd0b5c04c9e9bdfacfd8ac2e89497c86bcc015d105f48c982b/68747470733a2f2f7472617669732d63692e6f72672f6d7270726f6d70742f73696c65782d64692d6275696c6465722e706e67)](https://travis-ci.org/mrprompt/silex-di-builder)[![SensioLabsInsight](https://camo.githubusercontent.com/b0a304609d426dd070cd651272276ed6dcee46931526acaba0b79a463d423c82/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37623865643066632d326635612d346536662d383466642d3033303433306133343832652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7b8ed0fc-2f5a-4e6f-84fd-030430a3482e)[![Dependency Status](https://camo.githubusercontent.com/94baba0256e4876d21337a28b5d53aa346e934b3994844291afec44cdadc0e39/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535646464653635323338336539303032353030303036642f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/55ddde652383e9002500006d)[![Average time to resolve an issue](https://camo.githubusercontent.com/d22c73d61ef6c7b062a84973ded6b157a78252ddd53fe702bd910b10b6734f5f/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f6d7270726f6d70742f53696c65782d64692d6275696c6465722e737667)](http://isitmaintained.com/project/mrprompt/Silex-di-builder "Average time to resolve an issue")[![Percentage of issues still open](https://camo.githubusercontent.com/da9a0794c365f2128a4d4b77b177592b560f2bbb385656a98ed0927842199a3f/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f6d7270726f6d70742f53696c65782d64692d6275696c6465722e737667)](http://isitmaintained.com/project/mrprompt/Silex-di-builder "Percentage of issues still open")[![Codacy Badge](https://camo.githubusercontent.com/f67f78b6966ed36b8043b143f40fb7aa34b96e62147e440010319a23e6fe3733/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f67726164652f3433303337306631656630613435643738636230313964313235666639356137)](https://www.codacy.com/app/mrprompt/silex-di-builder)[![Code Climate](https://camo.githubusercontent.com/db9a9a9693c6142c09a065f86916a8ebb945417c75a73701a5c6bf5484013143/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d7270726f6d70742f73696c65782d64692d6275696c6465722f6261646765732f6770612e737667)](https://codeclimate.com/github/mrprompt/silex-di-builder)

A simple dependency injection builder to Silex based on YAML file config.

Install
=======

[](#install)

```
composer require chacal/silex-di-builder

```

Usage
-----

[](#usage)

Simple create a di.yml - or other name, of course - file with the structure:

```
services:
  alias1:
    - Full\Class\Name
    - dependency1

  alias2:
    - Full\ClassTwo\Name
    - dependency1
    - dependency2

```

When:

- *alias1* - Is the alias from Silex
- *Full\\Class\\Name* and *Full\\ClassTwo\\Name* - The class name to initialize
- *dependency1* and *dependecy2* - Dependencies from the class, must be an alias previously created

In your application bootstrap, register YAML Config Service Provider, with your DI file

```

use DerAlex\Silex\YamlConfigServiceProvider;
use MrPrompt\Silex\Di\Container as DiServiceProvider;

....

$app->register(new YamlConfigServiceProvider(__DIR__ . '/../Resources/di.yml'));
$app->register(new DiServiceProvider());

```

Now, your services is available on $app container.

Testing
-------

[](#testing)

Just run *phpunit* without parameters

```
phpunit

```

Happy Silex Coding :)

silex-di-container-provider
===========================

[](#silex-di-container-provider)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/df4bdf046d195e621cecb93f3a07034f5bfc572bb854476207a16f8d3870c70a?d=identicon)[chacal88](/maintainers/chacal88)

---

Top Contributors

[![chacal88](https://avatars.githubusercontent.com/u/3899413?v=4)](https://github.com/chacal88 "chacal88 (2 commits)")

### Embed Badge

![Health badge](/badges/chacal-silex-di-builder/health.svg)

```
[![Health](https://phpackages.com/badges/chacal-silex-di-builder/health.svg)](https://phpackages.com/packages/chacal-silex-di-builder)
```

PHPackages © 2026

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