-
Notifications
You must be signed in to change notification settings - Fork 0
/
CallbackInterface.php
123 lines (111 loc) · 2.81 KB
/
CallbackInterface.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
/**
* File defining Backend\Interfaces\CallbackInterface.
*
* PHP Version 5.3
*
* @category Backend
* @package Interfaces
* @author J Jurgens du Toit <jrgns@backend-php.net>
* @copyright 2011 - 2012 Jade IT (cc)
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @link http://backend-php.net
*/
namespace Backend\Interfaces;
/**
* Callable functions or object\class and method pairs to be executed by the
* Application.
*
* @category Backend
* @package Interfaces
* @author J Jurgens du Toit <jrgns@backend-php.net>
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @link http://backend-php.net
*/
interface CallbackInterface
{
/**
* Set the class name for a static method call.
*
* @param string $class The name of the class of the callback.
*
* @return CallbackInterface The current callback.
*/
public function setClass($class);
/**
* Get the class name of the static method call.
*
* @return string
*/
public function getClass();
/**
* Set the object for a method call.
*
* @param object $object The object of the callback.
*
* @return CallbackInterface The current callback.
*/
public function setObject($object);
/**
* Get the object of the method call.
*
* @return object
*/
public function getObject();
/**
* Set the method name for a method call.
*
* @param string $method The method name of the callback.
*
* @return CallbackInterface The current callback.
*/
public function setMethod($method);
/**
* Get the method name of the method call.
*
* @return string
*/
public function getMethod();
/**
* Set the function as the callback.
*
* @param callable $function The function.
*
* @return CallbackInterface The current callback.
*/
public function setFunction($function);
/**
* Get the callback function.
*
* @return callable
*/
public function getFunction();
/**
* Set the arguments for the callback.
*
* @param array $arguments The arguments for the callback.
*
* @return CallbackInterface The current callback.
*/
public function setArguments(array $arguments);
/**
* Get the arguments of the callback.
*
* @return array
*/
public function getArguments();
/**
* Execute the callback.
*
* @param array $arguments The arguments with which to execute the callback.
*
* @return mixed The result of the callback.
*/
public function execute(array $arguments = array());
/**
* Convert the callback to a string.
*
* @return string
*/
public function __toString();
}