fastd / event
FastD Event
v1.0.0
2016-11-19 15:17 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^5.0
This package is not auto-updated.
Last update: 2024-12-21 21:36:37 UTC
README
Simple Event and EventManager
Requirements
- PHP >= 5.6
Installation
composer require "fastd/event:1.0.x-dev" -vvv
Usage Event
$event = new \FastD\Event\Event('demo', function () { return 'demo event'; }); $result = $event->broadcast(); $this->assertEquals(['demo event'], $result);
Usage EventDispatch
$eventDispatch = new \FastD\Event\EventDispatcher(); $eventDispatch->on('demo', new DemoListener()); echo $eventDispatch->trigger('demo'); $this->expectOutputString('handle ok');
PHPUnit
phpunit