PHPackages                             gilsegura/shared-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. gilsegura/shared-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

gilsegura/shared-bundle
=======================

Symfony integration for the `gilsegura/shared` package.

2.1.0(2d ago)271MITPHPPHP ^8.4CI passing

Since Nov 28Pushed 2w ago1 watchersCompare

[ Source](https://github.com/gilsegura/shared-bundle)[ Packagist](https://packagist.org/packages/gilsegura/shared-bundle)[ RSS](/packages/gilsegura-shared-bundle/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (18)Versions (11)Used By (0)

SHARED BUNDLE
=============

[](#shared-bundle)

[![tests](https://github.com/gilsegura/shared-bundle/actions/workflows/tests.yaml/badge.svg)](https://github.com/gilsegura/shared-bundle/actions/workflows/tests.yaml)[![codecov](https://camo.githubusercontent.com/dece6a31d2adb41d8abf8d7e68b2495914220e3a90bcbde801035b05f11f7616/68747470733a2f2f636f6465636f762e696f2f6769746875622f67696c7365677572612f7368617265642d62756e646c652f67726170682f62616467652e737667)](https://codecov.io/github/gilsegura/shared-bundle)[![static analysis](https://github.com/gilsegura/shared-bundle/actions/workflows/static-analysis.yaml/badge.svg)](https://github.com/gilsegura/shared-bundle/actions/workflows/static-analysis.yaml)[![coding standards](https://github.com/gilsegura/shared-bundle/actions/workflows/coding-standards.yaml/badge.svg)](https://github.com/gilsegura/shared-bundle/actions/workflows/coding-standards.yaml)

The Symfony integration for [`gilsegura/shared`](https://github.com/gilsegura/shared). It wires the framework-agnostic DDD/ES/CQRS building blocks to Symfony Messenger and Doctrine: command/query buses, a Doctrine-backed event store, DBAL types for the domain value objects, a criteria-to-Doctrine converter, and the event-bus plumbing.

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

[](#installation)

```
composer require gilsegura/shared-bundle
```

Requires PHP 8.4+, and runs on **Symfony 7.4 and 8.1**. Register the bundle (it declares its dependency on DoctrineBundle, so make sure DoctrineBundle is installed):

```
// config/bundles.php
return [
    // ...
    SharedBundle\SharedBundle::class => ['all' => true],
];
```

What it provides
----------------

[](#what-it-provides)

### Command &amp; query buses (Messenger)

[](#command--query-buses-messenger)

`MessengerCommandBus` and `MessengerQueryBus` implement the `shared``CommandBusInterface` / `QueryBusInterface` on top of Symfony Messenger. They unwrap `HandlerFailedException` so your handlers' real exceptions surface instead of Messenger's wrapper. The bundle preconfigures three buses:

- `messenger.bus.command` — synchronous, transactional (`doctrine_transaction`).
- `messenger.bus.query` — synchronous, no transaction.
- `messenger.bus.event.async` — for asynchronous domain-event handling.

### Doctrine event store

[](#doctrine-event-store)

`DoctrineEventStore` persists and loads `DomainEventStream`s through Doctrine, serializing payloads with `gilsegura/serializer`.

### DBAL types for the domain value objects

[](#dbal-types-for-the-domain-value-objects)

Doctrine DBAL types so the `shared` value objects map transparently to columns: `uuid`, `email`, `hashed_password`, `not_empty_string`, `serializable`, and an immutable `datetime`. They are registered automatically via the bundle's `prependExtension`, so you can use them directly in your mappings.

### Criteria → Doctrine

[](#criteria--doctrine)

`DoctrineCriteriaConverter` translates the `shared` criteria/expression tree (`AndX`, `OrX`, `Comparison`, `OrderX`) into a Doctrine `Criteria`, so a query built with the `shared` DSL runs against a Doctrine repository. `AbstractObjectManager` gives you a typed base for Doctrine-backed repositories.

### Event-bus wiring

[](#event-bus-wiring)

Services implementing `Shared\EventHandling\EventListenerInterface` are autoconfigured with a tag, and `EventBusSubscriberPass` injects them into the `SimpleEventBus` at compile time. `EventPublisher` flushes recorded domain messages to the async event bus on kernel/console/worker termination, so events are published after the response is sent.

Symfony 7.4 and 8.1
-------------------

[](#symfony-74-and-81)

The bundle targets both the current LTS (7.4) and the latest stable (8.1). The dependency on DoctrineBundle is declared through `getBundleDependencies()` rather than the `#[RequiredBundle]` attribute, since that attribute only exists in Symfony 8.1+; every other API used here is stable across both versions.

Design notes
------------

[](#design-notes)

- **Thin integration layer.** All domain logic lives in `gilsegura/shared`; this package only adapts it to Symfony and Doctrine.
- **Exceptions are typed and unwrapped.** Infrastructure failures become `MessengerBusException` / `ObjectManagerException`; handler exceptions are unwrapped from Messenger's `HandlerFailedException`.
- **PHP 8.4, strictly analysed.** Built and checked under PHPStan `max` with strict rules and the Symfony extension.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

48

↑

FairBetter than 93% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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 ~64 days

Recently: every ~3 days

Total

10

Last Release

2d ago

Major Versions

0.0.1 → 1.0.02026-06-13

1.1.4 → 2.0.02026-06-29

PHP version history (3 changes)0.0.1PHP &gt;=8.3

1.0.0PHP ^8.5

1.1.1PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29969702?v=4)[josué](/maintainers/gilsegura)[@gilsegura](https://github.com/gilsegura)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gilsegura-shared-bundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M386](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[sulu/sulu

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

1.3k1.4M203](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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