PHPackages                             micro-module/decorator-bundle - 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. micro-module/decorator-bundle

ActiveLibrary[Framework](/categories/framework)

micro-module/decorator-bundle
=============================

Symfony bundle to handle decorators in the service containers

v1.1.4(3y ago)0154MITPHPPHP ~7.4 | ~8.0 | ~8.1

Since Apr 2Pushed 3y agoCompare

[ Source](https://github.com/temafey/DecoratorBundle)[ Packagist](https://packagist.org/packages/micro-module/decorator-bundle)[ RSS](/packages/micro-module-decorator-bundle/feed)WikiDiscussions master Synced 1mo ago

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

DecoratorBundle for Symfony
===========================

[](#decoratorbundle-for-symfony)

[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/InterNations/DecoratorBundle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Build Status](https://camo.githubusercontent.com/d1c2e85c9baa44356b2e0773fb26751e937e3c8012eb5bae5ed2f789e133d1ae/68747470733a2f2f7472617669732d63692e6f72672f496e7465724e6174696f6e732f4465636f7261746f7242756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/InterNations/DecoratorBundle) [![Dependency Status](https://camo.githubusercontent.com/42a87305acae09145a4f66f3de9882ea26cb975cf16c322c5f9ad0001277eba8/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3533343739633636666530643037323062353030303037632f62616467652e706e67)](https://www.versioneye.com/user/projects/53479c66fe0d0720b500007c) [![Average time to resolve an issue](https://camo.githubusercontent.com/5e03291a6deed0d0a20ba424ccae1c4369a5367366286a87208d3762d91992cc/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f496e7465724e6174696f6e732f4465636f7261746f7242756e646c652e737667)](http://isitmaintained.com/project/InterNations/DecoratorBundle "Average time to resolve an issue") [![Percentage of issues still open](https://camo.githubusercontent.com/72567c07e276b4fa61b6d5d2b6099022e11d99c75d8e974dda6c65ba86ba091e/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f496e7465724e6174696f6e732f4465636f7261746f7242756e646c652e737667)](http://isitmaintained.com/project/InterNations/DecoratorBundle "Percentage of issues still open")

Provides consistent decorator handling for the Symfony Dependency Injection Container.

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

[](#installation)

For Symfony 3.3 up to 4:

```
composer require internations/decorator-bundle
```

For Symfony &lt; 3.3:

```
composer require internations/decorator-bundle:~0
```

Usage
-----

[](#usage)

### "Decorate this"-mode

[](#decorate-this-mode)

In "decorate this"-mode you declare your decorators in the dependency at hand. A configuration example:

```

        element1
        element2

```

The configuration above will create this instance:

```
$iterator = new InfiniteIterator(
    new ArrayIterator(['element1', 'element2'])
);
```

### "Decorate other" mode

[](#decorate-other-mode)

In "decorate other"-mode you declare the subjects you are decorating in the decorator definition itself. A configuration example:

```

        element1
        element2

```

The configuration above will again create this instance:

```
$iterator = new InfiniteIterator(
    new ArrayIterator(['element1', 'element2'])
);
```

### Specifying priorities

[](#specifying-priorities)

To control the order of decoration, setting a priority flag for the decorator is supported. Priority can be between `PHP_INT_MAX` and `-PHP_INT_MAX`, the default priority is `0`.

```

```

### Using the Bundle programmatically

[](#using-the-bundle-programmatically)

In cases where you want to reuse the decoration functionality outside of the XML config, you can use the following API in your Compiler Pass. Here is an example to add decorate service `common_service` with the decorator `special_decorator` and priority `255`.

```
namespace …;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use InterNations\Bundle\DecoratorBundle\Tagger\DecorationTagger;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class MyCompilerPass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        DecorationTagger::tag($container, 'common_service', 'special_decorator', 255);
    }
}
```

Credits
-------

[](#credits)

Based on Dovydas Bartkevicius’ idea, with a bunch of input from Max Beutel.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 76.9% 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 ~213 days

Recently: every ~202 days

Total

15

Last Release

1441d ago

Major Versions

v0.9.1 → v1.0.02020-03-18

PHP version history (4 changes)v0.5.0PHP &gt;=5.6

v0.8.0PHP ~7

v0.9.1PHP ~7.1

v1.1.1PHP ~7.4 | ~8.0 | ~8.1

### Community

Maintainers

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

---

Top Contributors

[![lstrojny](https://avatars.githubusercontent.com/u/79707?v=4)](https://github.com/lstrojny "lstrojny (30 commits)")[![phanan](https://avatars.githubusercontent.com/u/8056274?v=4)](https://github.com/phanan "phanan (4 commits)")[![temafey](https://avatars.githubusercontent.com/u/981101?v=4)](https://github.com/temafey "temafey (4 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/micro-module-decorator-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/micro-module-decorator-bundle/health.svg)](https://phpackages.com/packages/micro-module-decorator-bundle)
```

###  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)[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)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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