- Posted on October 4, 2014
As a PHP developer, I love using RedBean as an ORM and Silex as a micro-framework. But I have to admit the fact the former comes as a static class isn't quite handy sometimes.

I was looking for a solution to make the two of these communicate with each other in a better way. Some effort has already been put into it, but the linked package doesn't help with the main issue I described above, so I decided to roll out my own.

Here comes a RedBean service provider for Silex, available through Composer and following the PSR-2 and PSR-4 standards. It's dead simple, and mainly serves one purpose : make RedBean available as an instance through Silex's service containing capabilities (which should help with mocking while writing unit tests). Using it thus allows you to write code like the following :