@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * (PECL mongo >= 1.1.0)<br/> |
35 | 35 | * Returns the address being used by this for slaveOkay reads |
36 | 36 | * @link http://php.net/manual/en/mongo.getslave.php |
37 | - * @return bool <p>The address of the secondary this connection is using for reads. |
|
37 | + * @return boolean|null <p>The address of the secondary this connection is using for reads. |
|
38 | 38 | * </p> |
39 | 39 | * <p> |
40 | 40 | * This returns <b>NULL</b> if this is not connected to a replica set or not yet |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * (PECL mongo >= 1.1.0)<br/> |
47 | 47 | * Get slaveOkay setting for this connection |
48 | 48 | * @link http://php.net/manual/en/mongo.getslaveokay.php |
49 | - * @return bool Returns the value of slaveOkay for this instance. |
|
49 | + * @return boolean|null Returns the value of slaveOkay for this instance. |
|
50 | 50 | */ |
51 | 51 | public function getSlaveOkay() {} |
52 | 52 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @deprecated Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method. |
55 | 55 | * @link http://www.php.net/manual/en/mongo.pairconnect.php |
56 | 56 | * @throws MongoConnectionException |
57 | - * @return boolean |
|
57 | + * @return boolean|null |
|
58 | 58 | */ |
59 | 59 | public function pairConnect() {} |
60 | 60 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * If reads should be sent to secondary members of a replica set for all |
91 | 91 | * possible queries using this {@see MongoClient} instance. |
92 | 92 | * </p> |
93 | - * @return bool returns the former value of slaveOkay for this instance. |
|
93 | + * @return boolean|null returns the former value of slaveOkay for this instance. |
|
94 | 94 | */ |
95 | 95 | public function setSlaveOkay ($ok) {} |
96 | 96 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * Set the size for future connection pools. |
100 | 100 | * @link http://php.net/manual/en/mongo.setpoolsize.php |
101 | 101 | * @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> |
102 | - * @return bool Returns the former value of pool size. |
|
102 | + * @return boolean|null Returns the former value of pool size. |
|
103 | 103 | */ |
104 | 104 | public function setPoolSize($size) {} |
105 | 105 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param string $username A username used to identify the connection. |
110 | 110 | * @param string $password A password used to identify the connection. |
111 | 111 | * @throws MongoConnectionException |
112 | - * @return boolean If the connection was successful. |
|
112 | + * @return boolean|null If the connection was successful. |
|
113 | 113 | */ |
114 | 114 | public function persistConnect($username = "", $password = "") {} |
115 | 115 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param string $username A username used to identify the connection. |
121 | 121 | * @param string $password A password used to identify the connection. |
122 | 122 | * @throws MongoConnectionException |
123 | - * @return boolean If the connection was successful. |
|
123 | + * @return boolean|null If the connection was successful. |
|
124 | 124 | */ |
125 | 125 | public function pairPersistConnect($username = "", $password = "") {} |
126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * |
130 | 130 | * @link http://www.php.net/manual/en/mongo.connectutil.php |
131 | 131 | * @throws MongoConnectionException |
132 | - * @return boolean If the connection was successful. |
|
132 | + * @return boolean|null If the connection was successful. |
|
133 | 133 | */ |
134 | 134 | protected function connectUtil() {} |
135 | 135 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * Creates a database error on the database. |
162 | 162 | * @deprecated Use MongoDB::forceError() instead. |
163 | 163 | * @link http://www.php.net/manual/en/mongo.forceerror.php |
164 | - * @return boolean The database response. |
|
164 | + * @return boolean|null The database response. |
|
165 | 165 | */ |
166 | 166 | public function forceError() {} |
167 | 167 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | * </p> |
93 | 93 | * @return bool returns the former value of slaveOkay for this instance. |
94 | 94 | */ |
95 | - public function setSlaveOkay ($ok) {} |
|
95 | + public function setSlaveOkay($ok) {} |
|
96 | 96 | /** |
97 | 97 | * @deprecated Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead. |
98 | 98 | *(PECL mongo >= 1.2.0)<br/> |
@@ -207,7 +207,7 @@ |
||
207 | 207 | * Lists all of the databases available |
208 | 208 | * |
209 | 209 | * @link http://php.net/manual/en/mongoclient.listdbs.php |
210 | - * @return array Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving the database's name, size, and if it's empty. The other two fields are totalSize (in bytes) and ok, which is 1 if this method ran successfully. |
|
210 | + * @return MongoDB\Model\DatabaseInfoLegacyIterator Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving the database's name, size, and if it's empty. The other two fields are totalSize (in bytes) and ok, which is 1 if this method ran successfully. |
|
211 | 211 | */ |
212 | 212 | public function listDBs() |
213 | 213 | { |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | class MongoClient |
24 | 24 | { |
25 | 25 | const VERSION = '1.6.12'; |
26 | - const DEFAULT_HOST = "localhost" ; |
|
27 | - const DEFAULT_PORT = 27017 ; |
|
28 | - const RP_PRIMARY = "primary" ; |
|
29 | - const RP_PRIMARY_PREFERRED = "primaryPreferred" ; |
|
30 | - const RP_SECONDARY = "secondary" ; |
|
31 | - const RP_SECONDARY_PREFERRED = "secondaryPreferred" ; |
|
32 | - const RP_NEAREST = "nearest" ; |
|
26 | + const DEFAULT_HOST = "localhost"; |
|
27 | + const DEFAULT_PORT = 27017; |
|
28 | + const RP_PRIMARY = "primary"; |
|
29 | + const RP_PRIMARY_PREFERRED = "primaryPreferred"; |
|
30 | + const RP_SECONDARY = "secondary"; |
|
31 | + const RP_SECONDARY_PREFERRED = "secondaryPreferred"; |
|
32 | + const RP_NEAREST = "nearest"; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @var bool |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * {@link http://www.php.net/manual/en/class.mongoint64.php MongoInt64} class. The latter is necessary on 32 |
199 | 199 | * bit platforms (and Windows). |
200 | 200 | */ |
201 | - public function killCursor($server_hash , $id) |
|
201 | + public function killCursor($server_hash, $id) |
|
202 | 202 | { |
203 | 203 | |
204 | 204 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * information on distributing reads to secondaries. |
164 | 164 | * </p> |
165 | 165 | * @link http://www.php.net/manual/en/mongocollection.getslaveokay.php |
166 | - * @return bool Returns the value of slaveOkay for this instance. |
|
166 | + * @return boolean|null Returns the value of slaveOkay for this instance. |
|
167 | 167 | */ |
168 | 168 | public function getSlaveOkay() |
169 | 169 | { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * If reads should be sent to secondary members of a replica set for all |
182 | 182 | * possible queries using this {@link http://www.php.net/manual/en/class.mongocollection.php MongoCollection} |
183 | 183 | * instance. |
184 | - * @return bool Returns the former value of slaveOkay for this instance. |
|
184 | + * @return boolean|null Returns the former value of slaveOkay for this instance. |
|
185 | 185 | * </p> |
186 | 186 | */ |
187 | 187 | public function setSlaveOkay($ok = true) |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * (PECL mongo >= 1.3.0)<br/> |
205 | 205 | * @param string $read_preference <p>The read preference mode: <b>MongoClient::RP_PRIMARY</b>, <b>MongoClient::RP_PRIMARY_PREFERRED</b>, <b>MongoClient::RP_SECONDARY</b>, <b>MongoClient::RP_SECONDARY_PREFERRED</b>, or <b>MongoClient::RP_NEAREST</b>.</p> |
206 | 206 | * @param array $tags [optional] <p>An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.<p> |
207 | - * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
207 | + * @return boolean|null Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
208 | 208 | */ |
209 | 209 | public function setReadPreference($read_preference, array $tags) |
210 | 210 | { |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. |
253 | 253 | * @throws MongoCursorException if the "w" option is set and the write fails. |
254 | 254 | * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. |
255 | - * @return bool|array Returns an array containing the status of the insertion if the "w" option is set. |
|
255 | + * @return MongoDB\InsertOneResult Returns an array containing the status of the insertion if the "w" option is set. |
|
256 | 256 | * Otherwise, returns TRUE if the inserted array is not empty (a MongoException will be thrown if the inserted array is empty). |
257 | 257 | * If an array is returned, the following keys may be present: |
258 | 258 | * <dl> |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @param array $a An array of arrays. |
290 | 290 | * @param array $options Options for the inserts. |
291 | 291 | * @throws MongoCursorException |
292 | - * @return mixed f "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occured ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise. |
|
292 | + * @return MongoDB\InsertManyResult f "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occured ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise. |
|
293 | 293 | */ |
294 | 294 | public function batchInsert(array $a, array $options = array()) |
295 | 295 | { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @link http://www.php.net/manual/en/mongocollection.ensureindex.php |
438 | 438 | * @param array $keys Field or fields to use as index. |
439 | 439 | * @param array $options [optional] This parameter is an associative array of the form array("optionname" => <boolean>, ...). |
440 | - * @return boolean always true |
|
440 | + * @return boolean|null always true |
|
441 | 441 | */ |
442 | 442 | public function ensureIndex(array $keys, array $options = array()) {} |
443 | 443 |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | * @throws MongoCursorException |
326 | 326 | * @return boolean |
327 | 327 | */ |
328 | - public function update(array $criteria , array $newobj, array $options = array()) |
|
328 | + public function update(array $criteria, array $newobj, array $options = array()) |
|
329 | 329 | { |
330 | 330 | $multiple = ($options['multiple']) ? $options['multiple'] : false; |
331 | 331 | // $multiple = $options['multiple'] ?? false; |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | * @param array $query An optional query parameters |
401 | 401 | * @return array|bool Returns an array of distinct values, or <b>FALSE</b> on failure |
402 | 402 | */ |
403 | - public function distinct ($key, array $query = NULL) {} |
|
403 | + public function distinct($key, array $query = NULL) {} |
|
404 | 404 | |
405 | 405 | /** |
406 | 406 | * Update a document and return it |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @param array $options An array of options to apply, such as remove the match document from the DB and return it. |
412 | 412 | * @return array Returns the original document, or the modified document when new is set. |
413 | 413 | */ |
414 | - public function findAndModify (array $query, array $update = NULL, array $fields = NULL, array $options = NULL) {} |
|
414 | + public function findAndModify(array $query, array $update = NULL, array $fields = NULL, array $options = NULL) {} |
|
415 | 415 | |
416 | 416 | /** |
417 | 417 | * Querys this collection, returning a single element |
@@ -41,7 +41,7 @@ |
||
41 | 41 | /** |
42 | 42 | * Checks if current position is valid |
43 | 43 | * @link http://php.net/manual/en/iterator.valid.php |
44 | - * @return boolean The return value will be casted to boolean and then evaluated. |
|
44 | + * @return boolean|null The return value will be casted to boolean and then evaluated. |
|
45 | 45 | * Returns true on success or false on failure. |
46 | 46 | * @since 5.0.0 |
47 | 47 | */ |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @return mixed Can return any type. |
21 | 21 | * @since 5.0.0 |
22 | 22 | */ |
23 | - public function current(){} |
|
23 | + public function current() {} |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Move forward to next element |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @return void Any returned value is ignored. |
29 | 29 | * @since 5.0.0 |
30 | 30 | */ |
31 | - public function next(){} |
|
31 | + public function next() {} |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Return the key of the current element |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @return mixed scalar on success, or null on failure. |
37 | 37 | * @since 5.0.0 |
38 | 38 | */ |
39 | - public function key(){} |
|
39 | + public function key() {} |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Checks if current position is valid |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * Returns true on success or false on failure. |
46 | 46 | * @since 5.0.0 |
47 | 47 | */ |
48 | - public function valid(){} |
|
48 | + public function valid() {} |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Rewind the Iterator to the first element |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return void Any returned value is ignored. |
54 | 54 | * @since 5.0.0 |
55 | 55 | */ |
56 | - public function rewind(){} |
|
56 | + public function rewind() {} |
|
57 | 57 | |
58 | 58 | function batchSize(int $batchSize):MongoCursorInterface{} |
59 | 59 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @link http://www.php.net/manual/en/mongocursor.hasnext.php |
60 | 60 | * @throws MongoConnectionException |
61 | 61 | * @throws MongoCursorTimeoutException |
62 | - * @return bool Returns true if there is another element |
|
62 | + * @return boolean|null Returns true if there is another element |
|
63 | 63 | */ |
64 | 64 | public function hasNext() {} |
65 | 65 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | /** |
169 | 169 | * Checks if there are documents that have not been sent yet from the database for this cursor |
170 | 170 | * @link http://www.php.net/manual/en/mongocursor.dead.php |
171 | - * @return boolean Returns if there are more results that have not been sent to the client, yet. |
|
171 | + * @return boolean|null Returns if there are more results that have not been sent to the client, yet. |
|
172 | 172 | */ |
173 | 173 | public function dead() {} |
174 | 174 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * Checks if the cursor is reading a valid result. |
253 | 253 | * @link http://www.php.net/manual/en/mongocursor.valid.php |
254 | - * @return boolean If the current result is not null. |
|
254 | + * @return boolean|null If the current result is not null. |
|
255 | 255 | */ |
256 | 256 | public function valid() {} |
257 | 257 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param bool $wait [optional] <p>If the cursor should wait for more data to become available.</p> |
54 | 54 | * @return MongoCursor Returns this cursor. |
55 | 55 | */ |
56 | - public function awaitData ($wait = true) {} |
|
56 | + public function awaitData($wait = true) {} |
|
57 | 57 | /** |
58 | 58 | * Checks if there are any more elements in this cursor |
59 | 59 | * @link http://www.php.net/manual/en/mongocursor.hasnext.php |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @return array This function returns an array describing the read preference. The array contains the values <em>type</em> for the string |
79 | 79 | * read preference mode (corresponding to the {@link http://www.php.net/manual/en/class.mongoclient.php MongoClient} constants), and <em>tagsets</em> containing a list of all tag set criteria. If no tag sets were specified, <em>tagsets</em> will not be present in the array. |
80 | 80 | */ |
81 | - public function getReadPreference () { } |
|
81 | + public function getReadPreference() { } |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * Limits the number of results returned |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param bool $okay [optional] <p>If receiving partial results is okay.</p> |
96 | 96 | * @return MongoCursor Returns this cursor. |
97 | 97 | */ |
98 | - public function partial ($okay = true) {} |
|
98 | + public function partial($okay = true) {} |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * (PECL mongo >= 1.2.1)<br/> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param bool $set [optional] <p>Whether the flag should be set (<b>TRUE</b>) or unset (<b>FALSE</b>).</p> |
110 | 110 | * @return MongoCursor |
111 | 111 | */ |
112 | - public function setFlag ($flag, $set = true ) {} |
|
112 | + public function setFlag($flag, $set = true) {} |
|
113 | 113 | |
114 | 114 | /** |
115 | 115 | * (PECL mongo >= 1.3.3)<br/> |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param array $tags [optional] <p>The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.</p> |
119 | 119 | * @return MongoCursor Returns this cursor. |
120 | 120 | */ |
121 | - public function setReadPreference ($read_preference, array $tags) {} |
|
121 | + public function setReadPreference($read_preference, array $tags) {} |
|
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Skips a number of results |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | * @throws MongoCursorException |
285 | 285 | * @return MongoCursor |
286 | 286 | */ |
287 | - public function fields(array $f){} |
|
287 | + public function fields(array $f) {} |
|
288 | 288 | |
289 | 289 | /** |
290 | 290 | * Gets the query, fields, limit, and skip for this cursor |
291 | 291 | * @link http://www.php.net/manual/en/mongocursor.info.php |
292 | 292 | * @return array The query, fields, limit, and skip for this cursor as an associative array. |
293 | 293 | */ |
294 | - public function info(){} |
|
294 | + public function info() {} |
|
295 | 295 | |
296 | 296 | /** |
297 | 297 | * PECL mongo >=1.0.11 |
@@ -321,6 +321,6 @@ discard block |
||
321 | 321 | * @return MongoCursor Returns this cursor. |
322 | 322 | * @link http://docs.php.net/manual/en/mongocursor.batchsize.php |
323 | 323 | */ |
324 | - public function batchSize($batchSize){} |
|
324 | + public function batchSize($batchSize) {} |
|
325 | 325 | } |
326 | 326 |
@@ -266,7 +266,6 @@ discard block |
||
266 | 266 | * (PECL mongo >= 0.9.0)<br/> |
267 | 267 | * Get a list of collections in this database |
268 | 268 | * @link http://www.php.net/manual/en/mongodb.listcollections.php |
269 | - * @param bool $includeSystemCollections [optional] <p>Include system collections.</p> |
|
270 | 269 | * @return array Returns a list of MongoCollections. |
271 | 270 | */ |
272 | 271 | public function listCollections(array $options = []) |
@@ -410,7 +409,7 @@ discard block |
||
410 | 409 | * (PECL mongo >= 0.9.5)<br/> |
411 | 410 | * Creates a database error |
412 | 411 | * @link http://www.php.net/manual/en/mongodb.forceerror.php |
413 | - * @return boolean Returns the database response. |
|
412 | + * @return boolean|null Returns the database response. |
|
414 | 413 | */ |
415 | 414 | public function forceError() |
416 | 415 | { |
@@ -460,7 +459,7 @@ discard block |
||
460 | 459 | * @link http://www.php.net/manual/en/mongodb.setreadpreference.php |
461 | 460 | * @param string $read_preference <p>The read preference mode: <b>MongoClient::RP_PRIMARY</b>, <b>MongoClient::RP_PRIMARY_PREFERRED</b>, <b>MongoClient::RP_SECONDARY</b>, <b>MongoClient::RP_SECONDARY_PREFERRED</b>, or <b>MongoClient::RP_NEAREST</b>.</p> |
462 | 461 | * @param array $tags [optional] <p>An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.</p> |
463 | - * @return boolean Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
462 | + * @return boolean|null Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
464 | 463 | */ |
465 | 464 | public function setReadPreference($read_preference, array $tags) |
466 | 465 | { |
@@ -472,8 +471,7 @@ discard block |
||
472 | 471 | * @link http://php.net/manual/en/mongodb.setwriteconcern.php |
473 | 472 | * Set the write concern for this database |
474 | 473 | * @param mixed $w <p>The write concern. This may be an integer denoting the number of servers required to acknowledge the write, or a string mode (e.g. "majority").</p> |
475 | - * @param int $wtimeout[optional] <p>The maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
476 | - * @return boolean Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
474 | + * @return boolean|null Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
477 | 475 | */ |
478 | 476 | public function setWriteConcern($w, $wtimeout) |
479 | 477 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | $collections = $this->db->listCollections($options); |
105 | 105 | |
106 | - $getCollectionName = function (CollectionInfo $collectionInfo) { |
|
106 | + $getCollectionName = function(CollectionInfo $collectionInfo) { |
|
107 | 107 | return $collectionInfo->getName(); |
108 | 108 | }; |
109 | 109 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * </p> |
205 | 205 | * @return bool Returns the former value of slaveOkay for this instance. |
206 | 206 | */ |
207 | - public function setSlaveOkay ($ok = true) |
|
207 | + public function setSlaveOkay($ok = true) |
|
208 | 208 | { |
209 | 209 | return false; |
210 | 210 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | $id = isset($document_or_id->_id) ? $document_or_id->_id : null; |
297 | 297 | // $id = $document_or_id->_id ?? null; |
298 | 298 | } elseif (is_array($document_or_id)) { |
299 | - if (! isset($document_or_id['_id'])) { |
|
299 | + if (!isset($document_or_id['_id'])) { |
|
300 | 300 | return null; |
301 | 301 | } |
302 | 302 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | * @link http://php.net/manual/en/mongodbref.isref.php |
46 | 46 | * @static |
47 | 47 | * @param mixed $ref Array or object to check |
48 | - * @return boolean Returns true if $ref is a reference |
|
48 | + * @return boolean|null Returns true if $ref is a reference |
|
49 | 49 | */ |
50 | 50 | public static function isRef($ref) {} |
51 | 51 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @link http://php.net/manual/en/mongogridfs.construct.php |
46 | 46 | * @param MongoDB $db Database |
47 | 47 | * @param string $prefix [optional] <p>Optional collection name prefix.</p> |
48 | - * @param mixed $chunks [optional] |
|
48 | + * @param string $chunks [optional] |
|
49 | 49 | * @return MongoGridFS |
50 | 50 | */ |
51 | 51 | public function __construct($db, $prefix = "fs", $chunks = "fs") {} |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @param array $criteria Description of records to remove. |
101 | 101 | * @param array $options Options for remove. Valid options are: "safe"- Check that the remove succeeded. |
102 | 102 | * @throws MongoCursorException |
103 | - * @return boolean |
|
103 | + * @return boolean|null |
|
104 | 104 | */ |
105 | 105 | public function remove(array $criteria = array(), array $options = array()) {} |
106 | 106 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * Delete a file from the database |
109 | 109 | * @link http://php.net/manual/en/mongogridfs.delete.php |
110 | 110 | * @param mixed $id _id of the file to remove |
111 | - * @return boolean Returns true if the remove was successfully sent to the database. |
|
111 | + * @return boolean|null Returns true if the remove was successfully sent to the database. |
|
112 | 112 | */ |
113 | 113 | public function delete($id) {} |
114 | 114 |
@@ -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) |