PHPackages                             jmikola/wildcard-event-dispatcher - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. jmikola/wildcard-event-dispatcher

ActiveLibrary[Queues &amp; Workers](/categories/queues)

jmikola/wildcard-event-dispatcher
=================================

Event dispatcher with support for wildcard patterns inspired by AMQP topic exchanges.

3.0.0(1y ago)32320.9k↓11.2%6[2 issues](https://github.com/jmikola/WildcardEventDispatcher/issues)2MITPHPPHP ^7.2 || ^8.0CI passing

Since Feb 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/jmikola/WildcardEventDispatcher)[ Packagist](https://packagist.org/packages/jmikola/wildcard-event-dispatcher)[ Docs](https://github.com/jmikola/WildcardEventDispatcher)[ RSS](/packages/jmikola-wildcard-event-dispatcher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (12)Used By (2)

WildcardEventDispatcher
=======================

[](#wildcardeventdispatcher)

This library implements an event dispatcher, based on [Symfony's interface](https://github.com/symfony/EventDispatcher), with wildcard syntax inspired by AMQP topic exchanges. Listeners may be bound to a wildcard pattern and be notified if a dispatched event's name matches that pattern. Literal event name matching is still supported.

Note: the wildcard syntax used by this library is not compatible with the [simpler event dispatching](https://symfony.com/blog/new-in-symfony-4-3-simpler-event-dispatching) introduced in Symfony 4.3, which uses the FQCN of the event in lieu of a custom string (e.g. `core.request`).

If you are interested in using this library in a Symfony project, you may also want to take a look at the corresponding [bundle](https://github.com/jmikola/JmikolaWildcardEventDispatcherBundle).

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

[](#installation)

The library is published as a [package](https://packagist.org/packages/jmikola/wildcard-event-dispatcher) and is installable via [Composer](http://getcomposer.org/):

```
$ composer require jmikola/wildcard-event-dispatcher=^2.0

```

### Compatibility

[](#compatibility)

This library requires Symfony 4.3 or above.

Usage
-----

[](#usage)

WildcardEventDispatcher implements EventDispatcherInterface and may be used as you would Symfony's standard EventDispatcher:

```
