jnjxp/event

Event dispatching with DI resolution

0.1.0 2016-10-10 17:41 UTC

This package is auto-updated.

Last update: 2024-12-26 08:51:58 UTC


README

Event dispatching with DI resolution. Basically Evenement that can resolve listeners from DI container.

Latest version Build Status Coverage Status Quality Score

See: Evenement and Aura\DI provider

<?php

$resolver = function ($spec) use ($di) {
    return $di->get($spec);
};

$emitter = new Jnjxp\Event\Emitter($resolver);

$emitter->on('foo', Listener::class);

$emitter->emit('foo', $params);