瀏覽代碼

Fix magic access to properties in MongoDB class

Andreas Braun 10 年之前
父節點
當前提交
4dcca5e8c9
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      lib/Mongo/MongoDB.php

+ 11 - 1
lib/Mongo/MongoDB.php

@@ -30,11 +30,21 @@ class MongoDB
     const PROFILING_ON = 2;
 
     /**
+     * @var MongoClient
+     */
+    protected $connection;
+
+    /**
      * @var \MongoDB\Database
      */
     protected $db;
 
     /**
+     * @var string
+     */
+    protected $name;
+
+    /**
      * Creates a new database
      *
      * This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}.
@@ -44,7 +54,7 @@ class MongoDB
      * @throws Exception
      * @return MongoDB Returns the database.
      */
-    public function __construct($conn, $name)
+    public function __construct(MongoClient $conn, $name)
     {
         $this->connection = $conn;
         $this->name = $name;