PHPackages                             mrprompt/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. [Framework](/categories/framework)
4. /
5. mrprompt/silex-di-builder

ActiveLibrary[Framework](/categories/framework)

mrprompt/silex-di-builder
=========================

A simple dependency injection builder to Silex

1.0.3(9y ago)54044MITPHPPHP &gt;=5.6

Since Sep 17Pushed 9y agoCompare

[ Source](https://github.com/mrprompt/Silex-Di)[ Packagist](https://packagist.org/packages/mrprompt/silex-di-builder)[ RSS](/packages/mrprompt-silex-di-builder/feed)WikiDiscussions master Synced 2mo ago

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

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

[](#silex-di-builder)

[![Build Status](https://camo.githubusercontent.com/f22c0eb3b917f832ca47c8c102751a1635ec9ac1ff04d54a2a9d5b879995fdf0/68747470733a2f2f7472617669732d63692e6f72672f53696c6578467269656e64732f44692e706e67)](https://travis-ci.org/SilexFriends/Di)[![Code Climate](https://camo.githubusercontent.com/9e069ede89755c294c34204958076117642e7d88b9bbe0b6984e2da4a3fc08bf/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f53696c6578467269656e64732f44692f6261646765732f6770612e737667)](https://codeclimate.com/github/SilexFriends/Di)[![Test Coverage](https://camo.githubusercontent.com/ec97571e2b497c50111a26f9f03769f7f40f39cbac2697d05242b83e5032b452/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f53696c6578467269656e64732f44692f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/SilexFriends/Di/coverage)[![Issue Count](https://camo.githubusercontent.com/93a4305e36ca7e5cfba67e7047b1c924f527b1afac17a6776dd93c626e7896e0/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f53696c6578467269656e64732f44692f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/SilexFriends/Di)[![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)[![Codacy Badge](https://camo.githubusercontent.com/f67f78b6966ed36b8043b143f40fb7aa34b96e62147e440010319a23e6fe3733/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f67726164652f3433303337306631656630613435643738636230313964313235666639356137)](https://www.codacy.com/app/mrprompt/silex-di-builder)

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

Install
=======

[](#install)

```
composer require mrprompt/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 or anything

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

```

use DerAlex\Silex\YamlConfigServiceProvider;
use SilexFriends\DI\Container as DiServiceProvider;

....

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

# $app['config']['services'] is an array with yml content, created by YamlConfigServiceProvider

```

Now, your services is available on $app container.

Testing
-------

[](#testing)

Just run *phpunit* without parameters

```
phpunit

```

Happy Silex Coding :)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~107 days

Total

4

Last Release

3568d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d08744966e0d5783569605da853ef945dadac0be0f613f2eba6a052861d937a?d=identicon)[mrprompt](/maintainers/mrprompt)

---

Top Contributors

[![mrprompt](https://avatars.githubusercontent.com/u/166088?v=4)](https://github.com/mrprompt "mrprompt (34 commits)")[![kinncj](https://avatars.githubusercontent.com/u/292542?v=4)](https://github.com/kinncj "kinncj (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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