super-simple/event-dispatcher

Super Simple Event Dispatcher library implementing the PSR-14 standard.

v1.2 2022-07-17 08:14 UTC

This package is auto-updated.

Last update: 2024-10-25 15:33:38 UTC


README

A super simple event dispatcher library implementing PSR-14

Build Status Latest Stable Version PHP Version Require License Total Downloads

Install

composer require super-simple/event-dispatcher

Requires PHP 8.1 or newer.

Usage

Basic usage:

require '/path/to/vendor/autoload.php';

// New provider
$provider = new EventProvider();

// Register listener

$provider->addListener($listener, $eventName, $priority);

// New dispatcher
$dispatcher = new EventDispatcher($provider);

// Dispatch the event
$dispatcher->dispatch($event);

For more details check out the wiki.