1 | <?php |
||
23 | class SessionHandling |
||
24 | { |
||
25 | const SESSION_KEY = '__SESSIONWARE_SESSION__'; |
||
26 | |||
27 | /** |
||
28 | * @var Session |
||
29 | */ |
||
30 | protected $session; |
||
31 | |||
32 | /** |
||
33 | * Middleware constructor. |
||
34 | * |
||
35 | * @param Session $session |
||
36 | */ |
||
37 | public function __construct(Session $session) |
||
41 | |||
42 | /** |
||
43 | * Get session from request. |
||
44 | * |
||
45 | * @param ServerRequestInterface $request |
||
46 | * |
||
47 | * @return Session |
||
48 | */ |
||
49 | public static function getSession(ServerRequestInterface $request) : Session |
||
53 | |||
54 | /** |
||
55 | * Execute middleware. |
||
56 | * |
||
57 | * @param ServerRequestInterface $request |
||
58 | * @param ResponseInterface $response |
||
59 | * @param callable $next |
||
60 | * |
||
61 | * @throws \RuntimeException |
||
62 | * |
||
63 | * @return ResponseInterface |
||
64 | */ |
||
65 | public function __invoke( |
||
87 | } |
||
88 |