/
EventInterface.php
executable file
·65 lines (59 loc) · 1.42 KB
/
EventInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php namespace ZN\EventHandler;
/**
* ZN PHP Web Framework
*
* "Simplicity is the ultimate sophistication." ~ Da Vinci
*
* @package ZN
* @license MIT [http://opensource.org/licenses/MIT]
* @author Ozan UYKUN [ozan@znframework.com]
*/
interface EventInterface
{
/**
* Run event by event name
*
* @param string $eventName
* @param array $parameters
*
* @return bool
*/
public static function run(String $eventName, Array $parameters = []) : Bool;
/**
* Insert a listener.
*
* @param string|callable $eventName
* @param callable|int $callback
* @param int|null $priority
*/
public static function insert($eventName = NULL, $callback = NULL, $priority = NULL) : Event;
/**
* Select a listener.
*
* @param string $eventName
*
* @return array
*/
public static function selectListener(String $eventName) : Array;
/**
* Select all listeners.
*
* @return array
*/
public static function selectListeners() : Array;
/**
* Delete a listener.
*
* @param string $eventName
* @param mixed $callback = NULL
*
* @return bool
*/
public static function deleteListener(String $eventName, $callback = NULL) : Bool;
/**
* Delete all listeners.
*
* @return bool
*/
public static function deleteListeners() : Bool;
}