File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1616use MongoDB \BSON \Document ;
1717use MongoDB \BSON \UTCDateTime ;
1818use MongoDB \Collection ;
19+ use Override ;
1920
2021use function tap ;
2122use function time ;
@@ -32,20 +33,23 @@ public function close(): bool
3233 return true ;
3334 }
3435
36+ #[Override]
3537 public function gc ($ lifetime ): int
3638 {
3739 $ result = $ this ->getCollection ()->deleteMany (['last_activity ' => ['$lt ' => $ this ->getUTCDateTime (-$ lifetime )]]);
3840
3941 return $ result ->getDeletedCount () ?? 0 ;
4042 }
4143
44+ #[Override]
4245 public function destroy ($ sessionId ): bool
4346 {
4447 $ this ->getCollection ()->deleteOne (['_id ' => (string ) $ sessionId ]);
4548
4649 return true ;
4750 }
4851
52+ #[Override]
4953 public function read ($ sessionId ): string |false
5054 {
5155 $ result = $ this ->getCollection ()->findOne (
@@ -63,6 +67,7 @@ public function read($sessionId): string|false
6367 return false ;
6468 }
6569
70+ #[Override]
6671 public function write ($ sessionId , $ data ): bool
6772 {
6873 $ payload = $ this ->getDefaultPayload ($ data );
@@ -87,6 +92,7 @@ public function createTTLIndex(): void
8792 );
8893 }
8994
95+ #[Override]
9096 protected function getDefaultPayload ($ data ): array
9197 {
9298 $ payload = [
You can’t perform that action at this time.
0 commit comments