File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 16
16
use MongoDB \BSON \Document ;
17
17
use MongoDB \BSON \UTCDateTime ;
18
18
use MongoDB \Collection ;
19
+ use Override ;
19
20
20
21
use function tap ;
21
22
use function time ;
@@ -32,20 +33,26 @@ public function close(): bool
32
33
return true ;
33
34
}
34
35
36
+ /** @inheritdoc */
37
+ #[Override]
35
38
public function gc ($ lifetime ): int
36
39
{
37
40
$ result = $ this ->getCollection ()->deleteMany (['last_activity ' => ['$lt ' => $ this ->getUTCDateTime (-$ lifetime )]]);
38
41
39
42
return $ result ->getDeletedCount () ?? 0 ;
40
43
}
41
44
45
+ /** @inheritdoc */
46
+ #[Override]
42
47
public function destroy ($ sessionId ): bool
43
48
{
44
49
$ this ->getCollection ()->deleteOne (['_id ' => (string ) $ sessionId ]);
45
50
46
51
return true ;
47
52
}
48
53
54
+ /** @inheritdoc */
55
+ #[Override]
49
56
public function read ($ sessionId ): string |false
50
57
{
51
58
$ result = $ this ->getCollection ()->findOne (
@@ -63,6 +70,8 @@ public function read($sessionId): string|false
63
70
return false ;
64
71
}
65
72
73
+ /** inheritdoc */
74
+ #[Override]
66
75
public function write ($ sessionId , $ data ): bool
67
76
{
68
77
$ payload = $ this ->getDefaultPayload ($ data );
@@ -87,6 +96,8 @@ public function createTTLIndex(): void
87
96
);
88
97
}
89
98
99
+ /** @inheritdoc */
100
+ #[Override]
90
101
protected function getDefaultPayload ($ data ): array
91
102
{
92
103
$ payload = [
You can’t perform that action at this time.
0 commit comments