-
Notifications
You must be signed in to change notification settings - Fork 124
Expand file tree
/
Copy pathSessionManagerInterface.php
More file actions
47 lines (39 loc) · 1.18 KB
/
SessionManagerInterface.php
File metadata and controls
47 lines (39 loc) · 1.18 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
<?php
/*
* This file is part of the official PHP MCP SDK.
*
* A collaboration between Symfony and the PHP Foundation.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mcp\Server\Session;
use Symfony\Component\Uid\Uuid;
/**
* Factory interface for creating session instances.
* This allows for different session implementations and custom initialization logic.
*
* @author Kyrian Obikwelu <koshnawaza@gmail.com>
*/
interface SessionManagerInterface
{
/**
* Creates a new session with an auto-generated UUID.
* This is the standard factory method for creating sessions.
*/
public function create(): SessionInterface;
/**
* Creates a session with a specific UUID.
* Use this when you need to reconstruct a session with a known ID.
*/
public function createWithId(Uuid $id): SessionInterface;
/**
* Checks if a session with the given UUID exists.
*/
public function exists(Uuid $id): bool;
/**
* Destroys the session with the given UUID.
*/
public function destroy(Uuid $sessionId): bool;
public function gc(): void;
}