pe/component-cronos-dispatcher

v1.0.0 2019-11-22 11:23 UTC

This package is auto-updated.

Last update: 2022-11-22 18:27:51 UTC


README

The following versions of PHP are supported.

  • PHP 7.1+

Installation

To install, use composer:

php composer.phar require pe/component-cronos-dispatcher

Usage

<?php

namespace PE\Component\Cronos\Dispatcher;

$dispatcher = new EventDispatcher();
$dispatcher->attachListener('foo', function () { echo 'foo'; });
$dispatcher->attachListener('bar', function () { echo 'bar'; });

$dispatcher->trigger('bar');// prints 'bar'
$dispatcher->trigger('foo');// prints 'foo'