Skip to content

Instantly share code, notes, and snippets.

@eXeDK
Created April 3, 2015 20:10
Show Gist options
  • Save eXeDK/304f6c5824f21b082aa4 to your computer and use it in GitHub Desktop.
Save eXeDK/304f6c5824f21b082aa4 to your computer and use it in GitHub Desktop.
Event class
<?php
/**
* Class Event
*/
class Event {
/**
* Contains the function of the Event
*
* @var callable
*/
private $eventFunction;
/**
* Default constructor
*
* @param callable $function The function to be called
*/
public function __construct(callable $function) {
$this->eventFunction = $function;
}
/**
* Run the function in the Event
*/
public function run() {
call_user_func($this->eventFunction);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment