forked from jasny/session-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSessionInterface.php
More file actions
60 lines (48 loc) · 1.23 KB
/
Copy pathSessionInterface.php
File metadata and controls
60 lines (48 loc) · 1.23 KB
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
<?php
declare(strict_types=1);
namespace Jasny\Session;
use Jasny\Session\Flash\FlashBag;
/**
* Session data as object.
*
* @extends \ArrayAccess<string,mixed>
*/
interface SessionInterface extends \ArrayAccess
{
/**
* Start the session.
* @see session_start()
*/
public function start(): void;
/**
* Get the sessions status.
* @see session_status()
*/
public function status(): int;
/**
* Write session data and end session.
* @see session_write_close()
*/
public function stop(): void;
/**
* Discard session array changes and finish session.
* @see session_abort()
*/
public function abort(): void;
/**
* Clear all data from the session.
*/
public function clear(): void;
/**
* Add a flash message.
*
* @param string $type flash type, eg. 'error', 'notice' or 'success'
* @param string $message flash message
* @param string $contentType mime, eg 'text/plain' or 'text/html'
*/
public function flash(string $type, string $message, string $contentType = 'text/plain'): void;
/**
* Get the service for flash messages.
*/
public function flashes(): FlashBag;
}