PHPackages                             richcongress/bundle-toolbox - 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. richcongress/bundle-toolbox

ActiveSymfony-bundle

richcongress/bundle-toolbox
===========================

A set of classes and tools to quickly build a bundle

v2.0.0(1y ago)163.4k↓47.5%[2 PRs](https://github.com/rich-id/bundle-toolbox/pulls)20MITPHPPHP ^8.1

Since Jun 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/rich-id/bundle-toolbox)[ Packagist](https://packagist.org/packages/richcongress/bundle-toolbox)[ RSS](/packages/richcongress-bundle-toolbox/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (18)Used By (20)

RichCongress Bundle Toolbox
===========================

[](#richcongress-bundle-toolbox)

This version of the bundle requires Symfony 6.0+ and PHP 8.1+.

[![Package version](https://camo.githubusercontent.com/d809d17e35627023d4b494c7cabbddaae67585b25e150b7b0b8e8cf5344b78f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696368636f6e67726573732f62756e646c652d746f6f6c626f78)](https://packagist.org/packages/richcongress/bundle-toolbox)[![Build Status](https://camo.githubusercontent.com/ccf276d33602d726def877e08bd593cceef741a155b8133eabf1c7ad6eeaa9f0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72696368636f6e67726573732f62756e646c652d746f6f6c626f782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/richcongress/bundle-toolbox?branch=master)[![Coverage Status](https://camo.githubusercontent.com/6a0288bfd062b727e2526e57fa6953fee78670955a5816ba0029bf1d92363a97/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72696368636f6e67726573732f62756e646c652d746f6f6c626f782f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/richcongress/bundle-toolbox?branch=master)[![contributions welcome](https://camo.githubusercontent.com/9e93e892d0685e1bf7a1d0bd7c8410d6ecf2086a0a7b48dd58a6b96fa556ea2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/richcongress/bundle-toolbox/issues)[![License](https://camo.githubusercontent.com/4141875b9db06b6e19ee4c8c4f14f34b47dabb4fcdad7816e338a79666b0aacb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d7265642e737667)](LICENSE.md)

The bundle toolbox provides a set of abstract classes and tools to avoid code redundancy between the bundles.

Installation
============

[](#installation)

Create a new bundle, and add this bundle as a dependency.

```
composer require richcongress/bundle-toolbox
```

Quick start
===========

[](#quick-start)

Configuration
-------------

[](#configuration)

When creating a new Configuration, use the `AbstractConfiguration`, set correctly the `CONFIG_NODE` constant, and set the `buildConfiguration` function. The argument is the root node of your configuration.

```
class Configuration extends AbstractConfiguration
{
    public const CONFIG_NODE = 'bundle_toolbox_test';

    protected function buildConfiguration(ArrayNodeDefinition $rootNode): void
    {
        $rootNode
            ->children()
                ->booleanNode('test')->defaultFalse()->end()
            ->end();
    }
}
```

From your bundle, you could use the `get` static function to quickly retrieve the bundle configuration.

```
$this->specificConfiguration = Configuration::get($parameterBag, 'your_sub_configuration');
```

Extension
---------

[](#extension)

When creating the Extension, extends from `AbstractExtension`. You now have a new function available, `parseConfiguration` which process the configuration and load it in the ParameterBag of your container.

```
class BundleExtension extends AbstractExtension
{
    public function load(array $configs, ContainerBuilder $container): void
    {
        $this->parseConfiguration($container, new Configuration(), $configs);
    }
}
```

CompilerPass
------------

[](#compilerpass)

When creating a new CompilerPass, use the `AbstractCompilerPass` and add them from the `build()` function of your bundle.

```
public function build(ContainerBuilder $container): void
{
    CompilerPass::add($container);
}
```

You can also configure its Type and Priority using respectively the constants `TYPE` and `PRIORITY`.

You can use the `MANDATORY_SERVICES` constant to check quickly if the required services exists:

```
public const MANDATORY_SERVICES = ['service1', 'service2', 'service3'];

public function process(ContainerBuilder $container): void
{
    if (!self::checkMandatoryServices($container)) {
        return;
    }

    // ...
}
```

Bundle
------

[](#bundle)

When creating a new Bundle, use the `AbstractBundle`. If you want to add a CompilerPass, simply add it to the `COMPILER_PASSES` constant. If the compiler is an instance of `AbstractCompilerPass`, it will use the `add` method. If not, it will be added to the container using the default values.

Versioning
==========

[](#versioning)

The bundle toolbox follows [semantic versioning](https://semver.org/). In short the scheme is MAJOR.MINOR.PATCH where

1. MAJOR is bumped when there is a breaking change,
2. MINOR is bumped when a new feature is added in a backward-compatible way,
3. PATCH is bumped when a bug is fixed in a backward-compatible way.

Versions bellow 1.0.0 are considered experimental and breaking changes may occur at any time.

Contributing
============

[](#contributing)

Contributions are welcomed! There are many ways to contribute, and we appreciate all of them. Here are some of the major ones:

- [Bug Reports](https://github.com/richcongress/bundle-toolbox/issues): While we strive for quality software, bugs can happen and we can't fix issues we're not aware of. So please report even if you're not sure about it or just want to ask a question. If anything the issue might indicate that the documentation can still be improved!
- [Feature Request](https://github.com/richcongress/bundle-toolbox/issues): You have a use case not covered by the current api? Want to suggest a change or add something? We'd be glad to read about it and start a discussion to try to find the best possible solution.
- [Pull Request](https://github.com/richcongress/bundle-toolbox/merge_requests): Want to contribute code or documentation? We'd love that! If you need help to get started, GitHub as [documentation](https://help.github.com/articles/about-pull-requests/) on pull requests. We use the ["fork and pull model"](https://help.github.com/articles/about-collaborative-development-models/) were contributors push changes to their personnal fork and then create pull requests to the main repository. Please make your pull requests against the `master` branch.

As a reminder, all contributors are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).

Hacking
=======

[](#hacking)

You might use Docker and `docker-compose` to hack the project. Check out the following commands.

```
# Start the project
docker-compose up -d

# Install dependencies
docker-compose exec application composer install

# Run tests
docker-compose exec application bin/phpunit

# Run a bash within the container
docker-compose exec application bash
```

6. License
==========

[](#6-license)

The bundle toolbox is distributed under the terms of the MIT license.

See [LICENSE](LICENSE.md) for details.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance62

Regular maintenance activity

Popularity30

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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 ~111 days

Recently: every ~246 days

Total

14

Last Release

714d ago

Major Versions

v1.2.5 → v2.0.02024-06-03

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

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bfb5e4a3dde826e4cd3f92d24fdfbdce1415c77f3edd38fc3420b4988977e13?d=identicon)[HugoDumazeau](/maintainers/HugoDumazeau)

---

Top Contributors

[![NicolasGuilloux](https://avatars.githubusercontent.com/u/4090627?v=4)](https://github.com/NicolasGuilloux "NicolasGuilloux (48 commits)")[![mdevlamynck](https://avatars.githubusercontent.com/u/4378377?v=4)](https://github.com/mdevlamynck "mdevlamynck (5 commits)")

---

Tags

bundlebundle-toolboxsymfony

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/richcongress-bundle-toolbox/health.svg)

```
[![Health](https://phpackages.com/badges/richcongress-bundle-toolbox/health.svg)](https://phpackages.com/packages/richcongress-bundle-toolbox)
```

###  Alternatives

[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)

PHPackages © 2026

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