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 1616use MongoDB \BSON \Document ;
1717use MongoDB \BSON \UTCDateTime ;
1818use MongoDB \Collection ;
19+ use Override ;
1920
2021use function tap ;
2122use function time ;
@@ -32,20 +33,26 @@ public function close(): bool
3233 return true ;
3334 }
3435
36+ /** @inheritdoc */
37+ #[Override]
3538 public function gc ($ lifetime ): int
3639 {
3740 $ result = $ this ->getCollection ()->deleteMany (['last_activity ' => ['$lt ' => $ this ->getUTCDateTime (-$ lifetime )]]);
3841
3942 return $ result ->getDeletedCount () ?? 0 ;
4043 }
4144
45+ /** @inheritdoc */
46+ #[Override]
4247 public function destroy ($ sessionId ): bool
4348 {
4449 $ this ->getCollection ()->deleteOne (['_id ' => (string ) $ sessionId ]);
4550
4651 return true ;
4752 }
4853
54+ /** @inheritdoc */
55+ #[Override]
4956 public function read ($ sessionId ): string |false
5057 {
5158 $ result = $ this ->getCollection ()->findOne (
@@ -63,6 +70,8 @@ public function read($sessionId): string|false
6370 return false ;
6471 }
6572
73+ /** inheritdoc */
74+ #[Override]
6675 public function write ($ sessionId , $ data ): bool
6776 {
6877 $ payload = $ this ->getDefaultPayload ($ data );
@@ -87,6 +96,8 @@ public function createTTLIndex(): void
8796 );
8897 }
8998
99+ /** @inheritdoc */
100+ #[Override]
90101 protected function getDefaultPayload ($ data ): array
91102 {
92103 $ payload = [
You can’t perform that action at this time.
0 commit comments