whatisgithub

What is event-dispatcher?

symfony/event-dispatcher — explained in plain English

Analysis updated 2026-06-24

8,547PHPAudience · developerComplexity · 2/5Setup · easy

In one sentence

A standalone PHP library that lets different parts of an application communicate by dispatching named events and registering listeners, so modules stay independent and don't need to call each other directly.

Mindmap

mindmap
  root((EventDispatcher))
    Core Concept
      Named events
      Registered listeners
      Loose coupling
    Usage
      Dispatch events
      Register listeners
      Set priorities
    Integration
      Standalone package
      Any PHP project
      Full Symfony too
    Examples
      User registered
      Email triggers
      Analytics hooks
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add an event system to any PHP project so modules can react to application events without importing or calling each other.

USE CASE 2

Trigger a named event after creating a user account and attach separate listeners for sending email, logging, and assigning default roles.

USE CASE 3

Extract business logic into isolated listeners that fire on domain events, making a PHP application easier to test and extend.

What is it built with?

PHPSymfony

How does it compare?

symfony/event-dispatchersolidtime-io/solidtimephpspec/prophecy
Stars8,5478,5558,482
LanguagePHPPHPPHP
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedeveloperpm founderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min
No license information was mentioned in the description.

So what is it?

This repository contains the EventDispatcher component, one of the building blocks of the Symfony PHP framework. It is a library that lets different parts of an application talk to each other without being directly connected. The basic idea is that one piece of code can announce that something happened by dispatching a named event. Other pieces of code can register themselves as listeners for that event, and they will be called automatically when it fires. This pattern keeps components loosely coupled: the code that triggers the event does not need to know anything about the code that reacts to it. For example, an application might dispatch a "user registered" event after creating a new account. Separate listeners could then send a welcome email, update analytics, or assign default settings, each in their own isolated code block, without the registration logic knowing any of that exists. This component is a standalone package extracted from the Symfony framework, which means you can use it in any PHP project, not just those built with Symfony. The README is minimal because the full documentation lives on the Symfony website, where it covers configuration, priorities, event objects, and practical usage examples. The component is maintained as part of the main Symfony repository. Bug reports and contributions go there rather than to this standalone mirror.

Copy-paste prompts

Prompt 1
Using symfony/event-dispatcher in a plain PHP project (no full Symfony), show me the minimal setup to dispatch a custom OrderPlaced event and register two listeners.
Prompt 2
How do I set listener priorities in symfony/event-dispatcher so that one listener always runs before another on the same event?
Prompt 3
I want to stop other listeners from running after one listener handles an event in symfony/event-dispatcher. Show me how to use stopPropagation inside a listener.

Frequently asked questions

What is event-dispatcher?

A standalone PHP library that lets different parts of an application communicate by dispatching named events and registering listeners, so modules stay independent and don't need to call each other directly.

What language is event-dispatcher written in?

Mainly PHP. The stack also includes PHP, Symfony.

What license does event-dispatcher use?

No license information was mentioned in the description.

How hard is event-dispatcher to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is event-dispatcher for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.