2017 © Pedro Peláez
 

library simple-event

Simple events.

image

mozartk/simple-event

Simple events.

  • Thursday, May 24, 2018
  • by mozartk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

simple-event

Build Status Coverage Status Coverage Status OJD , (*1)

This is a simple PHP event implementation., (*2)

Installation

composer require mozartk/simple-event

Basic Usage

How to run

<?php

include "vendor/autoload.php";

use \mozartk\SimpleEvent\SimpleEvent;

$event = new SimpleEvent();
$event->set("event1", function(){
     return "Hello World";
});

$result = $event->emit("testEvent");

echo $result; //return Hello World

If you want to run only once..., (*3)

$event->one("event2", function(){
    return 111;
});
$result = $event->emit("testEvent");
echo $result; //return 1
$result = $event->emit("testEvent"); //Exceptions on this line.

..And set specific limits..., (*4)

$event->setWithCount("testEvent", function(){
    return 1;
}, 3);

$result = $event->emit("testEvent");
$result = $event->emit("testEvent");
$result = $event->emit("testEvent");
$result = $event->emit("testEvent"); //Exceptions on this line.

License

Made by mozartk.
The MIT License (MIT). Please see License File for more information., (*5)

The Versions

24/05 2018

dev-master

9999999-dev https://github.com/mozartk

Simple events.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

simple event

24/05 2018

v0.1.0

0.1.0.0 https://github.com/mozartk

Simple events.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

simple event