@@ -67,28 +67,28 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
67
67
* @throws \InvalidArgumentException When MongoClient or Mongo instance not provided
68
68
* @throws \InvalidArgumentException When "database" or "collection" not provided
69
69
*/
70
- public function __construct ($ mongo , array $ options )
71
- {
72
- if (!($ mongo instanceof \MongoClient || $ mongo instanceof \Mongo || $ mongo instanceof \MongoDB \Client)) {
73
- throw new \InvalidArgumentException ('MongoClient, Mongo or MongoDB instance required ' );
74
- }elseif ($ mongo instanceof \MongoDB \Client && !class_exists ('\MongoDB\Collection ' )){
75
- throw new \InvalidArgumentException ('\MongoDB\Collection instance not loaded ' );
76
-
77
- }
78
-
79
- if (!isset ($ options ['database ' ]) || !isset ($ options ['collection ' ])) {
80
- throw new \InvalidArgumentException ('You must provide the "database" and "collection" option for MongoDBSessionHandler ' );
81
- }
82
-
83
- $ this ->mongo = $ mongo ;
84
-
85
- $ this ->options = array_merge (array (
86
- 'id_field ' => '_id ' ,
87
- 'data_field ' => 'data ' ,
88
- 'time_field ' => 'time ' ,
89
- 'expiry_field ' => 'expires_at ' ,
90
- ), $ options );
91
- }
70
+ public function __construct ($ mongo , array $ options )
71
+ {
72
+ if (!($ mongo instanceof \MongoClient || $ mongo instanceof \Mongo || $ mongo instanceof \MongoDB \Client)) {
73
+ throw new \InvalidArgumentException ('MongoClient, Mongo or MongoDB instance required ' );
74
+ }elseif ($ mongo instanceof \MongoDB \Client && !class_exists ('\MongoDB\Collection ' )){
75
+ throw new \InvalidArgumentException ('\MongoDB\Collection instance not loaded ' );
76
+
77
+ }
78
+
79
+ if (!isset ($ options ['database ' ]) || !isset ($ options ['collection ' ])) {
80
+ throw new \InvalidArgumentException ('You must provide the "database" and "collection" option for MongoDBSessionHandler ' );
81
+ }
82
+
83
+ $ this ->mongo = $ mongo ;
84
+
85
+ $ this ->options = array_merge (array (
86
+ 'id_field ' => '_id ' ,
87
+ 'data_field ' => 'data ' ,
88
+ 'time_field ' => 'time ' ,
89
+ 'expiry_field ' => 'expires_at ' ,
90
+ ), $ options );
91
+ }
92
92
93
93
/**
94
94
* {@inheritdoc}
0 commit comments