PHPackages                             moodev/bounce - 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. moodev/bounce

AbandonedLibrary[Framework](/categories/framework)

moodev/bounce
=============

Dependency injection framework for PHP, similar to Spring

v1.3.1(10y ago)220.7k5[2 issues](https://github.com/moodev/bounce/issues)[1 PRs](https://github.com/moodev/bounce/pulls)ISCPHPPHP &gt;=5.4.0

Since Apr 25Pushed 7y ago8 watchersCompare

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

READMEChangelog (5)Dependencies (4)Versions (7)Used By (0)

Bounce
======

[](#bounce)

[![Build Status](https://camo.githubusercontent.com/178346f0737da5f13c2e2b6e924044dc29f1a8bace4fbd01207650935c2ea8a7/68747470733a2f2f7472617669732d63692e6f72672f6d6f6f6465762f626f756e63652e706e67)](https://travis-ci.org/moodev/bounce)

Bounce is a dependency injection framework for PHP, similar to a sub-set of Spring. It used to be a standalone framework, which did a lot at runtime, and was therefore a bit expensive. It's now a front end to Symfony2's DI library, which is a fair bit more developed than Bounce was.

Usage
=====

[](#usage)

Create a context XML file (see some of the examples in the tests.)

Then:

New style using Symfony2
------------------------

[](#new-style-using-symfony2)

Use the BounceFileLoader in your Symfony2 app. Both the BounceFileLoader and the Symfony XMLFileLoader will try and claim all .xml files, which is less than ideal. You'll probably need to introduce some kind of delegating loader that filters by path, or file name, or something, in front of them to prevent this. Sorry.

Old style ApplicationContext interface and configs
--------------------------------------------------

[](#old-style-applicationcontext-interface-and-configs)

Instantiate a SymfonyApplicationContext. This will load the provided context into a new Symfony container and wrap it in the old ApplicationContext interface.

If you're looking for a migration path away from the Bounce XML format, but have significant usage of the ApplicationContext interface you could pass a different FileLoaderFactory to the SymfonyApplicationContext, which could allow services to be loaded from other styles of Symfony config. Sadly the bounce xml's import statement does not invoke the file loader, so bounce xml files cannot import things that aren't other bounce xml files.

ApplicationContext interface, externally provided container
-----------------------------------------------------------

[](#applicationcontext-interface-externally-provided-container)

The SymfonyContainerBeanFactory can wrap an existing container, and be used to instantiate the plain boring ApplicationContext. This will give you the ApplicationContext interface, with none of the rest of bounce's config stuff.

(of course there's nothing stopping you using the BounceFileLoader to load your own container for this, which is basically what the SymfonyApplicationContext is a shortcut to.)

What's supported
================

[](#whats-supported)

Only the basics. Property and constructor injection work. Beans can be constructed from factories. Lookup methods work, but only if the bean doesn't get created by a factory. Scoping is really basic. Singleton is the default. Prototype is, in theory, supported.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 75.6% 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 ~198 days

Recently: every ~157 days

Total

6

Last Release

3778d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.3.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7acad55e4d90e27736facd27c75c1629831cf733eac7272061672a89ddfc8118?d=identicon)[marcgear](/maintainers/marcgear)

---

Top Contributors

[![JonathanO](https://avatars.githubusercontent.com/u/1206546?v=4)](https://github.com/JonathanO "JonathanO (31 commits)")[![stevestorey](https://avatars.githubusercontent.com/u/1728140?v=4)](https://github.com/stevestorey "stevestorey (6 commits)")[![Gisleburt](https://avatars.githubusercontent.com/u/2369524?v=4)](https://github.com/Gisleburt "Gisleburt (3 commits)")[![marcgear](https://avatars.githubusercontent.com/u/54014?v=4)](https://github.com/marcgear "marcgear (1 commits)")

---

Tags

dependencyinjection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moodev-bounce/health.svg)

```
[![Health](https://phpackages.com/badges/moodev-bounce/health.svg)](https://phpackages.com/packages/moodev-bounce)
```

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

81733.7k](/packages/flow-php-flow)

PHPackages © 2026

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