@@ -200,7 +200,7 @@ |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | /** |
203 | - * @param $id |
|
203 | + * @param string|null $id |
|
204 | 204 | * @throws MongoException |
205 | 205 | */ |
206 | 206 | private function createObjectID($id) |
@@ -72,7 +72,7 @@ |
||
72 | 72 | protected $readPreference = []; |
73 | 73 | |
74 | 74 | /** |
75 | - * @return Cursor |
|
75 | + * @return \Traversable |
|
76 | 76 | */ |
77 | 77 | abstract protected function ensureCursor(); |
78 | 78 |
@@ -201,7 +201,7 @@ |
||
201 | 201 | * @link http://www.php.net/manual/en/mongocursor.hasnext.php |
202 | 202 | * @throws MongoConnectionException |
203 | 203 | * @throws MongoCursorTimeoutException |
204 | - * @return bool Returns true if there is another element |
|
204 | + * @return boolean|null Returns true if there is another element |
|
205 | 205 | */ |
206 | 206 | public function hasNext() |
207 | 207 | { |
@@ -126,6 +126,9 @@ |
||
126 | 126 | ); |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param resource $handle |
|
131 | + */ |
|
129 | 132 | private function writeFromRessource($handle) |
130 | 133 | { |
131 | 134 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * Returns the address being used by this for slaveOkay reads |
49 | 49 | * |
50 | 50 | * @link http://php.net/manual/en/mongo.getslave.php |
51 | - * @return bool The address of the secondary this connection is using for |
|
51 | + * @return boolean|null The address of the secondary this connection is using for |
|
52 | 52 | * reads. This returns NULL if this is not connected to a replica set or not yet |
53 | 53 | * initialized. |
54 | 54 | */ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * Get slaveOkay setting for this connection |
62 | 62 | * |
63 | 63 | * @link http://php.net/manual/en/mongo.getslaveokay.php |
64 | - * @return bool Returns the value of slaveOkay for this instance. |
|
64 | + * @return boolean|null Returns the value of slaveOkay for this instance. |
|
65 | 65 | */ |
66 | 66 | public function getSlaveOkay() |
67 | 67 | { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @link http://www.php.net/manual/en/mongo.pairconnect.php |
75 | 75 | * @throws MongoConnectionException |
76 | - * @return boolean |
|
76 | + * @return boolean|null |
|
77 | 77 | * |
78 | 78 | * @deprecated Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method. |
79 | 79 | */ |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @link http://php.net/manual/en/mongo.setslaveokay.php |
101 | 101 | * @param bool $ok |
102 | - * @return bool returns the former value of slaveOkay for this instance. |
|
102 | + * @return boolean|null returns the former value of slaveOkay for this instance. |
|
103 | 103 | */ |
104 | 104 | public function setSlaveOkay ($ok) |
105 | 105 | { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @link http://php.net/manual/en/mongo.setpoolsize.php |
113 | 113 | * @param $size <p>The max number of connections future pools will be able to create. Negative numbers mean that the pool will spawn an infinite number of connections.</p> |
114 | - * @return bool Returns the former value of pool size. |
|
114 | + * @return boolean|null Returns the former value of pool size. |
|
115 | 115 | * @deprecated Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead. |
116 | 116 | */ |
117 | 117 | public function setPoolSize($size) |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param string $username A username used to identify the connection. |
127 | 127 | * @param string $password A password used to identify the connection. |
128 | 128 | * @throws MongoConnectionException |
129 | - * @return boolean If the connection was successful. |
|
129 | + * @return boolean|null If the connection was successful. |
|
130 | 130 | * @deprecated Pass array("persist" => $id) to the constructor instead of using this method. |
131 | 131 | */ |
132 | 132 | public function persistConnect($username = "", $password = "") |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @param string $username A username used to identify the connection. |
142 | 142 | * @param string $password A password used to identify the connection. |
143 | 143 | * @throws MongoConnectionException |
144 | - * @return boolean If the connection was successful. |
|
144 | + * @return boolean|null If the connection was successful. |
|
145 | 145 | * @deprecated Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method. |
146 | 146 | */ |
147 | 147 | public function pairPersistConnect($username = "", $password = "") |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @link http://www.php.net/manual/en/mongo.connectutil.php |
156 | 156 | * @throws MongoConnectionException |
157 | - * @return boolean If the connection was successful. |
|
157 | + * @return boolean|null If the connection was successful. |
|
158 | 158 | */ |
159 | 159 | protected function connectUtil() |
160 | 160 | { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * Creates a database error on the database. |
202 | 202 | * |
203 | 203 | * @link http://www.php.net/manual/en/mongo.forceerror.php |
204 | - * @return boolean The database response. |
|
204 | + * @return boolean|null The database response. |
|
205 | 205 | * @deprecated Use MongoDB::forceError() instead. |
206 | 206 | */ |
207 | 207 | public function forceError() |
@@ -216,7 +216,7 @@ |
||
216 | 216 | * @link http://www.php.net/manual/en/mongoclient.killcursor.php |
217 | 217 | * @param string $server_hash The server hash that has the cursor. |
218 | 218 | * @param int|MongoInt64 $id The ID of the cursor to kill. |
219 | - * @return bool |
|
219 | + * @return boolean|null |
|
220 | 220 | */ |
221 | 221 | public function killCursor($server_hash , $id) |
222 | 222 | { |
@@ -468,7 +468,7 @@ |
||
468 | 468 | * @link http://www.php.net/manual/en/mongocollection.createindex.php |
469 | 469 | * @param array $keys Field or fields to use as index. |
470 | 470 | * @param array $options [optional] This parameter is an associative array of the form array("optionname" => <boolean>, ...). |
471 | - * @return array Returns the database response. |
|
471 | + * @return string|false Returns the database response. |
|
472 | 472 | * |
473 | 473 | * @todo This method does not yet return the correct result |
474 | 474 | */ |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * |
36 | 36 | * @link http://php.net/manual/en/mongopool.setsize.php |
37 | 37 | * @param int $size |
38 | - * @return boolean Returns the former value of pool size |
|
38 | + * @return integer Returns the former value of pool size |
|
39 | 39 | */ |
40 | 40 | public static function setSize($size) |
41 | 41 | { |
@@ -106,7 +106,6 @@ discard block |
||
106 | 106 | * @link http://php.net/manual/en/mongogridfs.find.php |
107 | 107 | * @param array $query The query |
108 | 108 | * @param array $fields Fields to return |
109 | - * @param array $options Options for the find command |
|
110 | 109 | * @return MongoGridFSCursor A MongoGridFSCursor |
111 | 110 | */ |
112 | 111 | public function find(array $query = [], array $fields = []) |
@@ -155,7 +154,7 @@ discard block |
||
155 | 154 | * @param string $filename The name of the file |
156 | 155 | * @param array $extra Other metadata to add to the file saved |
157 | 156 | * @param array $options An array of options for the insert operations executed against the chunks and files collections. |
158 | - * @return mixed Returns the _id of the saved object |
|
157 | + * @return MongoId Returns the _id of the saved object |
|
159 | 158 | */ |
160 | 159 | public function put($filename, array $extra = [], array $options = []) |
161 | 160 | { |
@@ -190,7 +189,7 @@ discard block |
||
190 | 189 | * @param string $bytes A string of bytes to store |
191 | 190 | * @param array $extra Other metadata to add to the file saved |
192 | 191 | * @param array $options Options for the store. "safe": Check that this store succeeded |
193 | - * @return mixed The _id of the object saved |
|
192 | + * @return MongoId The _id of the object saved |
|
194 | 193 | */ |
195 | 194 | public function storeBytes($bytes, array $extra = [], array $options = []) |
196 | 195 | { |
@@ -214,7 +213,7 @@ discard block |
||
214 | 213 | * @param string $filename The name of the file |
215 | 214 | * @param array $extra Other metadata to add to the file saved |
216 | 215 | * @param array $options Options for the store. "safe": Check that this store succeeded |
217 | - * @return mixed Returns the _id of the saved object |
|
216 | + * @return MongoId Returns the _id of the saved object |
|
218 | 217 | * @throws MongoGridFSException |
219 | 218 | * @throws Exception |
220 | 219 | */ |
@@ -265,7 +264,7 @@ discard block |
||
265 | 264 | * @link http://www.php.net/manual/en/mongogridfs.storeupload.php |
266 | 265 | * @param string $name The name attribute of the uploaded file, from <input type="file" name="something"/>. |
267 | 266 | * @param array $metadata An array of extra fields for the uploaded file. |
268 | - * @return mixed Returns the _id of the uploaded file. |
|
267 | + * @return null|MongoId Returns the _id of the uploaded file. |
|
269 | 268 | * @throws MongoGridFSException |
270 | 269 | */ |
271 | 270 | public function storeUpload($name, array $metadata = []) |
@@ -388,7 +387,7 @@ discard block |
||
388 | 387 | /** |
389 | 388 | * Returns the MD5 string for a file previously stored to the database |
390 | 389 | * |
391 | - * @param $id |
|
390 | + * @param MongoId $id |
|
392 | 391 | * @return string |
393 | 392 | */ |
394 | 393 | private function getMd5ForFile($id) |