|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace Limoncello\Application\Contracts\Session; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Copyright 2015-2020 [email protected] |
|
7
|
|
|
* |
|
8
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
9
|
|
|
* you may not use this file except in compliance with the License. |
|
10
|
|
|
* You may obtain a copy of the License at |
|
11
|
|
|
* |
|
12
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
13
|
|
|
* |
|
14
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
15
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
16
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
17
|
|
|
* See the License for the specific language governing permissions and |
|
18
|
|
|
* limitations under the License. |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Provides a separation layer for native PHP session functions. |
|
23
|
|
|
* |
|
24
|
|
|
* @package Limoncello\Contracts |
|
25
|
|
|
*/ |
|
26
|
|
|
interface SessionFunctionsInterface |
|
27
|
|
|
{ |
|
28
|
|
|
/** |
|
29
|
|
|
* @return callable |
|
30
|
|
|
*/ |
|
31
|
|
|
public function getRetrieveCallable(): callable; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param callable $callable |
|
35
|
|
|
* |
|
36
|
|
|
* @return self |
|
|
|
|
|
|
37
|
|
|
*/ |
|
38
|
|
|
public function setRetrieveCallable(callable $callable): self; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @return callable |
|
42
|
|
|
*/ |
|
43
|
|
|
public function getPutCallable(): callable; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @param callable $callable |
|
47
|
|
|
* |
|
48
|
|
|
* @return self |
|
|
|
|
|
|
49
|
|
|
*/ |
|
50
|
|
|
public function setPutCallable(callable $callable): self; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return callable |
|
54
|
|
|
*/ |
|
55
|
|
|
public function getHasCallable(): callable; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @param callable $callable |
|
59
|
|
|
* |
|
60
|
|
|
* @return self |
|
|
|
|
|
|
61
|
|
|
*/ |
|
62
|
|
|
public function setHasCallable(callable $callable): self; |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return callable |
|
66
|
|
|
*/ |
|
67
|
|
|
public function getDeleteCallable(): callable; |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @param callable $callable |
|
71
|
|
|
* |
|
72
|
|
|
* @return self |
|
|
|
|
|
|
73
|
|
|
*/ |
|
74
|
|
|
public function setDeleteCallable(callable $callable): self; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @return callable |
|
78
|
|
|
*/ |
|
79
|
|
|
public function getIteratorCallable(): callable; |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @param callable $callable |
|
83
|
|
|
* |
|
84
|
|
|
* @return self |
|
|
|
|
|
|
85
|
|
|
*/ |
|
86
|
|
|
public function setIteratorCallable(callable $callable): self; |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return callable |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getAbortCallable(): callable; |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* @param callable $callable |
|
95
|
|
|
* |
|
96
|
|
|
* @return self |
|
|
|
|
|
|
97
|
|
|
*/ |
|
98
|
|
|
public function setAbortCallable(callable $callable): self; |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @return callable |
|
102
|
|
|
*/ |
|
103
|
|
|
public function getCacheExpireCallable(): callable; |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* @param callable $callable |
|
107
|
|
|
* |
|
108
|
|
|
* @return self |
|
|
|
|
|
|
109
|
|
|
*/ |
|
110
|
|
|
public function setCacheExpireCallable(callable $callable): self; |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* @return callable |
|
114
|
|
|
*/ |
|
115
|
|
|
public function getCacheLimiterCallable(): callable; |
|
116
|
|
|
|
|
117
|
|
|
/** |
|
118
|
|
|
* @param callable $callable |
|
119
|
|
|
* |
|
120
|
|
|
* @return self |
|
|
|
|
|
|
121
|
|
|
*/ |
|
122
|
|
|
public function setCacheLimiterCallable(callable $callable): self; |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @return callable |
|
126
|
|
|
*/ |
|
127
|
|
|
public function getCreateIdCallable(): callable; |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* @param callable $callable |
|
131
|
|
|
* |
|
132
|
|
|
* @return self |
|
|
|
|
|
|
133
|
|
|
*/ |
|
134
|
|
|
public function setCreateIdCallable(callable $callable): self; |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* @return callable |
|
138
|
|
|
*/ |
|
139
|
|
|
public function getDecodeCallable(): callable; |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* @param callable $callable |
|
143
|
|
|
* |
|
144
|
|
|
* @return self |
|
|
|
|
|
|
145
|
|
|
*/ |
|
146
|
|
|
public function setDecodeCallable(callable $callable): self; |
|
147
|
|
|
|
|
148
|
|
|
/** |
|
149
|
|
|
* @return callable |
|
150
|
|
|
*/ |
|
151
|
|
|
public function getDestroyCallable(): callable; |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* @param callable $callable |
|
155
|
|
|
* |
|
156
|
|
|
* @return self |
|
|
|
|
|
|
157
|
|
|
*/ |
|
158
|
|
|
public function setDestroyCallable(callable $callable): self; |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* @return callable |
|
162
|
|
|
*/ |
|
163
|
|
|
public function getEncodeCallable(): callable; |
|
164
|
|
|
|
|
165
|
|
|
/** |
|
166
|
|
|
* @param callable $callable |
|
167
|
|
|
* |
|
168
|
|
|
* @return self |
|
|
|
|
|
|
169
|
|
|
*/ |
|
170
|
|
|
public function setEncodeCallable(callable $callable): self; |
|
171
|
|
|
|
|
172
|
|
|
/** |
|
173
|
|
|
* @return callable |
|
174
|
|
|
*/ |
|
175
|
|
|
public function getGcCallable(): callable; |
|
176
|
|
|
|
|
177
|
|
|
/** |
|
178
|
|
|
* @param callable $callable |
|
179
|
|
|
* |
|
180
|
|
|
* @return self |
|
|
|
|
|
|
181
|
|
|
*/ |
|
182
|
|
|
public function setGcCallable(callable $callable): self; |
|
183
|
|
|
|
|
184
|
|
|
/** |
|
185
|
|
|
* @return callable |
|
186
|
|
|
*/ |
|
187
|
|
|
public function getGetCookieParamsCallable(): callable; |
|
188
|
|
|
|
|
189
|
|
|
/** |
|
190
|
|
|
* @param callable $callable |
|
191
|
|
|
* |
|
192
|
|
|
* @return self |
|
|
|
|
|
|
193
|
|
|
*/ |
|
194
|
|
|
public function setGetCookieParamsCallable(callable $callable): self; |
|
195
|
|
|
|
|
196
|
|
|
/** |
|
197
|
|
|
* @return callable |
|
198
|
|
|
*/ |
|
199
|
|
|
public function getIdCallable(): callable; |
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* @param callable $callable |
|
203
|
|
|
* |
|
204
|
|
|
* @return self |
|
|
|
|
|
|
205
|
|
|
*/ |
|
206
|
|
|
public function setIdCallable(callable $callable): self; |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* @return callable |
|
210
|
|
|
*/ |
|
211
|
|
|
public function getModuleNameCallable(): callable; |
|
212
|
|
|
|
|
213
|
|
|
/** |
|
214
|
|
|
* @param callable $callable |
|
215
|
|
|
* |
|
216
|
|
|
* @return self |
|
|
|
|
|
|
217
|
|
|
*/ |
|
218
|
|
|
public function setModuleNameCallable(callable $callable): self; |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* @return callable |
|
222
|
|
|
*/ |
|
223
|
|
|
public function getNameCallable(): callable; |
|
224
|
|
|
|
|
225
|
|
|
/** |
|
226
|
|
|
* @param callable $callable |
|
227
|
|
|
* |
|
228
|
|
|
* @return self |
|
|
|
|
|
|
229
|
|
|
*/ |
|
230
|
|
|
public function setNameCallable(callable $callable): self; |
|
231
|
|
|
|
|
232
|
|
|
/** |
|
233
|
|
|
* @return callable |
|
234
|
|
|
*/ |
|
235
|
|
|
public function getRegenerateIdCallable(): callable; |
|
236
|
|
|
|
|
237
|
|
|
/** |
|
238
|
|
|
* @param callable $callable |
|
239
|
|
|
* |
|
240
|
|
|
* @return self |
|
|
|
|
|
|
241
|
|
|
*/ |
|
242
|
|
|
public function setRegenerateIdCallable(callable $callable): self; |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* @return callable |
|
246
|
|
|
*/ |
|
247
|
|
|
public function getRegisterShutdownCallable(): callable; |
|
248
|
|
|
|
|
249
|
|
|
/** |
|
250
|
|
|
* @param callable $callable |
|
251
|
|
|
* |
|
252
|
|
|
* @return self |
|
|
|
|
|
|
253
|
|
|
*/ |
|
254
|
|
|
public function setRegisterShutdownCallable(callable $callable): self; |
|
255
|
|
|
|
|
256
|
|
|
/** |
|
257
|
|
|
* @return callable |
|
258
|
|
|
*/ |
|
259
|
|
|
public function getResetCallable(): callable; |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* @param callable $callable |
|
263
|
|
|
* |
|
264
|
|
|
* @return self |
|
|
|
|
|
|
265
|
|
|
*/ |
|
266
|
|
|
public function setResetCallable(callable $callable): self; |
|
267
|
|
|
|
|
268
|
|
|
/** |
|
269
|
|
|
* @return callable |
|
270
|
|
|
*/ |
|
271
|
|
|
public function getSavePathCallable(): callable; |
|
272
|
|
|
|
|
273
|
|
|
/** |
|
274
|
|
|
* @param callable $callable |
|
275
|
|
|
* |
|
276
|
|
|
* @return self |
|
|
|
|
|
|
277
|
|
|
*/ |
|
278
|
|
|
public function setSavePathCallable(callable $callable): self; |
|
279
|
|
|
|
|
280
|
|
|
/** |
|
281
|
|
|
* @return callable |
|
282
|
|
|
*/ |
|
283
|
|
|
public function getSetCookieParamsCallable(): callable; |
|
284
|
|
|
|
|
285
|
|
|
/** |
|
286
|
|
|
* @param callable $callable |
|
287
|
|
|
* |
|
288
|
|
|
* @return self |
|
|
|
|
|
|
289
|
|
|
*/ |
|
290
|
|
|
public function setSetCookieParamsCallable(callable $callable): self; |
|
291
|
|
|
|
|
292
|
|
|
/** |
|
293
|
|
|
* @return callable |
|
294
|
|
|
*/ |
|
295
|
|
|
public function getSetSaveHandlerCallable(): callable; |
|
296
|
|
|
|
|
297
|
|
|
/** |
|
298
|
|
|
* @param callable $callable |
|
299
|
|
|
* |
|
300
|
|
|
* @return self |
|
|
|
|
|
|
301
|
|
|
*/ |
|
302
|
|
|
public function setSetSaveHandlerCallable(callable $callable): self; |
|
303
|
|
|
|
|
304
|
|
|
/** |
|
305
|
|
|
* @return callable |
|
306
|
|
|
*/ |
|
307
|
|
|
public function getStartCallable(): callable; |
|
308
|
|
|
|
|
309
|
|
|
/** |
|
310
|
|
|
* @param callable $callable |
|
311
|
|
|
* |
|
312
|
|
|
* @return self |
|
|
|
|
|
|
313
|
|
|
*/ |
|
314
|
|
|
public function setStartCallable(callable $callable): self; |
|
315
|
|
|
|
|
316
|
|
|
/** |
|
317
|
|
|
* @return callable |
|
318
|
|
|
*/ |
|
319
|
|
|
public function getStatusCallable(): callable; |
|
320
|
|
|
|
|
321
|
|
|
/** |
|
322
|
|
|
* @param callable $callable |
|
323
|
|
|
* |
|
324
|
|
|
* @return self |
|
|
|
|
|
|
325
|
|
|
*/ |
|
326
|
|
|
public function setStatusCallable(callable $callable): self; |
|
327
|
|
|
|
|
328
|
|
|
/** |
|
329
|
|
|
* @return callable |
|
330
|
|
|
*/ |
|
331
|
|
|
public function getUnsetCallable(): callable; |
|
332
|
|
|
|
|
333
|
|
|
/** |
|
334
|
|
|
* @param callable $callable |
|
335
|
|
|
* |
|
336
|
|
|
* @return self |
|
|
|
|
|
|
337
|
|
|
*/ |
|
338
|
|
|
public function setUnsetCallable(callable $callable): self; |
|
339
|
|
|
|
|
340
|
|
|
/** |
|
341
|
|
|
* @return callable |
|
342
|
|
|
*/ |
|
343
|
|
|
public function getWriteCloseCallable(): callable; |
|
344
|
|
|
|
|
345
|
|
|
/** |
|
346
|
|
|
* @param callable $callable |
|
347
|
|
|
* |
|
348
|
|
|
* @return self |
|
|
|
|
|
|
349
|
|
|
*/ |
|
350
|
|
|
public function setWriteCloseCallable(callable $callable): self; |
|
351
|
|
|
|
|
352
|
|
|
/** |
|
353
|
|
|
* @return callable |
|
354
|
|
|
*/ |
|
355
|
|
|
public function getCouldBeStartedCallable(): callable; |
|
356
|
|
|
|
|
357
|
|
|
/** |
|
358
|
|
|
* @param callable $callable |
|
359
|
|
|
* |
|
360
|
|
|
* @return self |
|
|
|
|
|
|
361
|
|
|
*/ |
|
362
|
|
|
public function setCouldBeStartedCallable(callable $callable): self; |
|
363
|
|
|
} |
|
364
|
|
|
|
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.