Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Utils; |
15 | |
16 | /** |
17 | * Pop utils callable interface |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Utils |
21 | * @author Nick Sagona, III <dev@nolainteractive.com> |
22 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
23 | * @license http://www.popphp.org/license New BSD License |
24 | * @version 2.1.0 |
25 | */ |
26 | interface CallableInterface |
27 | { |
28 | |
29 | /** |
30 | * Set callable |
31 | * |
32 | * @param mixed $callable |
33 | * @return CallableInterface |
34 | */ |
35 | public function setCallable(mixed $callable): CallableInterface; |
36 | |
37 | /** |
38 | * Get callable |
39 | * |
40 | * @return mixed |
41 | */ |
42 | public function getCallable(): mixed; |
43 | |
44 | /** |
45 | * Get callable type |
46 | * |
47 | * @return ?string |
48 | */ |
49 | public function getCallableType(): ?string; |
50 | |
51 | /** |
52 | * Set parameters |
53 | * |
54 | * @param array $parameters |
55 | * @return CallableInterface |
56 | */ |
57 | public function setParameters(array $parameters): CallableInterface; |
58 | |
59 | /** |
60 | * Add parameters |
61 | * |
62 | * @param array $parameters |
63 | * @return CallableInterface |
64 | */ |
65 | public function addParameters(array $parameters): CallableInterface; |
66 | |
67 | /** |
68 | * Add a parameter |
69 | * |
70 | * @param mixed $parameter |
71 | * @return CallableInterface |
72 | */ |
73 | public function addParameter(mixed $parameter): CallableInterface; |
74 | |
75 | /** |
76 | * Add a parameter |
77 | * |
78 | * @param string $name |
79 | * @param mixed $parameter |
80 | * @return CallableInterface |
81 | */ |
82 | public function addNamedParameter(string $name, mixed $parameter): CallableInterface; |
83 | |
84 | /** |
85 | * Get parameters |
86 | * |
87 | * @return array |
88 | */ |
89 | public function getParameters(): array; |
90 | |
91 | /** |
92 | * Get a parameter |
93 | * |
94 | * @param string $key |
95 | * @return mixed |
96 | */ |
97 | public function getParameter(string $key): mixed; |
98 | |
99 | /** |
100 | * Has parameters |
101 | * |
102 | * @return bool |
103 | */ |
104 | public function hasParameters(): bool; |
105 | |
106 | /** |
107 | * Has a parameter |
108 | * |
109 | * @param string $key |
110 | * @return bool |
111 | */ |
112 | public function hasParameter(string $key): bool; |
113 | |
114 | /** |
115 | * Remove a parameter |
116 | * |
117 | * @param string $key |
118 | * @return CallableInterface |
119 | */ |
120 | public function removeParameter(string $key): CallableInterface; |
121 | |
122 | /** |
123 | * Remove all parameters |
124 | * |
125 | * @return CallableInterface |
126 | */ |
127 | public function removeParameters(): CallableInterface; |
128 | |
129 | /** |
130 | * Set constructor parameters for instance call |
131 | * |
132 | * @param array $constructorParams |
133 | * @return CallableInterface |
134 | */ |
135 | public function setConstructorParams(array $constructorParams): CallableInterface; |
136 | |
137 | /** |
138 | * Get constructor parameters for instance call |
139 | * |
140 | * @return array |
141 | */ |
142 | public function getConstructorParams(): array; |
143 | |
144 | /** |
145 | * Get a constructor parameter for instance call |
146 | * |
147 | * @param string $key |
148 | * @return mixed |
149 | */ |
150 | public function getConstructorParam(string $key): mixed; |
151 | |
152 | /** |
153 | * Has constructor parameters for instance call |
154 | * |
155 | * @return bool |
156 | */ |
157 | public function hasConstructorParams(): bool; |
158 | |
159 | /** |
160 | * Has a constructor parameter for instance call |
161 | * |
162 | * @param string $key |
163 | * @return bool |
164 | */ |
165 | public function hasConstructorParam(string $key): bool; |
166 | |
167 | /** |
168 | * Remove a constructor parameter for instance call |
169 | * |
170 | * @param string $key |
171 | * @return CallableInterface |
172 | */ |
173 | public function removeConstructorParam(string $key): CallableInterface; |
174 | |
175 | /** |
176 | * Remove all constructor parameters for instance call |
177 | * |
178 | * @return CallableInterface |
179 | */ |
180 | public function removeConstructorParams(): CallableInterface; |
181 | |
182 | /** |
183 | * Check if object is callable |
184 | * |
185 | * @return bool |
186 | */ |
187 | public function isCallable(): bool; |
188 | |
189 | /** |
190 | * Check if object was called |
191 | * |
192 | * @return bool |
193 | */ |
194 | public function wasCalled(): bool; |
195 | |
196 | /** |
197 | * Prepare object for call |
198 | * |
199 | * @return CallableInterface |
200 | */ |
201 | public function prepare(): CallableInterface; |
202 | |
203 | /** |
204 | * Prepare parameters |
205 | * |
206 | * @return CallableInterface |
207 | */ |
208 | public function prepareParameters(): CallableInterface; |
209 | |
210 | /** |
211 | * Execute the call |
212 | * |
213 | * @param mixed $parameters |
214 | * @return mixed |
215 | */ |
216 | public function call(mixed $parameters = null): mixed; |
217 | |
218 | } |