PHPackages                             ustal/stream-hub-symfony-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. ustal/stream-hub-symfony-bundle

ActiveSymfony-bundle

ustal/stream-hub-symfony-bundle
===============================

Symfony bundle for Stream Hub integration and wiring

v1.0.0(1mo ago)02↓100%MITPHPPHP ^8.2CI passing

Since Apr 8Pushed 4w agoCompare

[ Source](https://github.com/ustal/stream-hub-symfony-bundle)[ Packagist](https://packagist.org/packages/ustal/stream-hub-symfony-bundle)[ RSS](/packages/ustal-stream-hub-symfony-bundle/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (2)Dependencies (9)Versions (3)Used By (0)

stream-hub-symfony-bundle
=========================

[](#stream-hub-symfony-bundle)

[![CI](https://github.com/ustal/stream-hub-symfony-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/ustal/stream-hub-symfony-bundle/actions/workflows/ci.yml)

Thin Symfony wiring for Stream Hub.

This package targets:

- `stream-hub-core ^1.0`
- `stream-hub-plugins ^1.0`

In the `v1` direction this bundle focuses on:

- low-level and feature command bus wiring;
- guard wiring for high-level feature commands;
- registration of built-in identifier generators;
- registration of low-level core handlers;
- optional registration of feature handlers when their dependencies are configured.

It is intentionally not a rendering or asset-integration bundle anymore.

Main Entry Point
----------------

[](#main-entry-point)

The bundle registers:

- `Ustal\StreamHub\SymfonyBundle\Registry\StreamHubRegistry`
- `Ustal\StreamHub\Core\StreamHubInterface`

`StreamHubRegistry` is the preferred application-facing entry point.

`StreamHubInterface` remains as a backward-compatible alias to the `default` instance only.

Minimal Configuration
---------------------

[](#minimal-configuration)

```
# config/packages/stream_hub.yaml
stream_hub:
  backend_service: app.stream_backend
  context_service: app.stream_context
  id_generators: {}
```

If only one of `backend_service` or `context_service` is configured, the bundle throws during container loading.

This legacy root-level configuration is treated as the `default` Stream Hub instance.

Named Instances
---------------

[](#named-instances)

The bundle also supports multiple named instances:

```
stream_hub:
  backend_service: app.default_stream_backend
  context_service: app.default_stream_context

  instances:
    audit:
      backend_service: app.audit_stream_backend
      context_service: app.audit_stream_context
      id_generators:
        stream-lifecycle:
          system_event_id: uuid_v7
```

Generated service ids:

- `stream_hub.instance.default.stream_hub`
- `stream_hub.instance.audit.stream_hub`

Recommended usage:

```
use Ustal\StreamHub\SymfonyBundle\Registry\StreamHubRegistry;

final class AuditController
{
    public function __construct(
        private readonly StreamHubRegistry $streamHubs,
    ) {}

    public function __invoke(): void
    {
        $default = $this->streamHubs->get();
        $audit = $this->streamHubs->get('audit');
    }
}
```

Instance services are internal implementation details. For multi-instance applications, inject the registry and resolve the needed Stream Hub explicitly.

The legacy aliases still point to the `default` instance:

- `Ustal\StreamHub\Core\StreamHubInterface`
- `Ustal\StreamHub\Core\Command\CommandBusInterface`
- `Ustal\StreamHub\Core\Command\ModelCommandBusInterface`

This means existing single-instance applications continue to work without changes:

```
use Ustal\StreamHub\Core\StreamHubInterface;

final class LegacyController
{
    public function __construct(
        private readonly StreamHubInterface $streamHub,
    ) {}
}
```

Optional Message Module Wiring
------------------------------

[](#optional-message-module-wiring)

To enable the message module handler wiring:

```
stream_hub:
  backend_service: app.stream_backend
  context_service: app.stream_context
  id_generators:
    message-composer:
      event_id: uuid_v7
```

Built-in generator names:

- `random_hex`
- `uuid_v4`
- `uuid_v7`

Custom Symfony service ids may also be used instead of a built-in generator name.

Optional Stream Lifecycle Module Wiring
---------------------------------------

[](#optional-stream-lifecycle-module-wiring)

To enable the lifecycle module handler wiring:

```
stream_hub:
  backend_service: app.stream_backend
  context_service: app.stream_context
  id_generators:
    stream-lifecycle:
      system_event_id: uuid_v7
```

Guards
------

[](#guards)

High-level commands may be protected by tagged guard services. Guards are applied only to the feature bus. The low-level model bus stays unguarded.

Register a guard as a regular Symfony service and tag it with:

```
services:
  App\StreamHub\Guard\SendMessageGuard:
    tags:
      - { name: stream_hub.command_guard }
```

Query Side
----------

[](#query-side)

The bundle does not try to introduce a storage-agnostic query DSL.

For now the application-facing facade keeps only simple read operations:

- stream list
- single stream lookup
- unread counters

Anything more specific than that should stay in the project backend or in project-specific query services.

Development
-----------

[](#development)

Install dependencies:

```
make install
```

Run tests:

```
make test
```

Run deptrac:

```
make deptrac
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

31d ago

### Community

Maintainers

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

---

Top Contributors

[![ustal](https://avatars.githubusercontent.com/u/11928397?v=4)](https://github.com/ustal "ustal (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ustal-stream-hub-symfony-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ustal-stream-hub-symfony-bundle/health.svg)](https://phpackages.com/packages/ustal-stream-hub-symfony-bundle)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M648](/packages/sylius-sylius)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[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.3k](/packages/contao-core-bundle)

PHPackages © 2026

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