epa/epa-plugins

0.2.1 2014-12-16 17:20 UTC

This package is auto-updated.

Last update: 2024-04-29 02:38:23 UTC


README

These are plugins to use with Epa.

Currently there is one plugin: MetaEventNamePlugin. This plugin can be used to name events based on the @event tag on a plugin doccomment:

/**
 * @event MyCustomEventName
 */
public class MyPlugin implements \Epa\Api\Plugin
{}

This allows plugins to register handlers for the event MyCustomEventName instead of only the classname.

You can add the plugin using the Epa library as follows:

$plugin = \EpaPlugins\MetaEventNamePluginFactory::create();
$eventDispatcher = \Epa\EventDispatcherFactory::create();
$eventDispatcher->addPlugin($plugin);