@@ -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 | } |
@@ -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 |
@@ -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 @@ 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) |
@@ -97,7 +97,7 @@ |
||
97 | 97 | * |
98 | 98 | * <p>The log message itself.</p></li> |
99 | 99 | * <ul> |
100 | - * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
100 | + * @return boolean|null Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
101 | 101 | */ |
102 | 102 | public static function setCallback ( callable $log_function ) {} |
103 | 103 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | * <ul> |
100 | 100 | * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
101 | 101 | */ |
102 | - public static function setCallback ( callable $log_function ) {} |
|
102 | + public static function setCallback(callable $log_function) {} |
|
103 | 103 | |
104 | 104 | /** |
105 | 105 | * This function can be used to set how verbose logging should be and the types of |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * @param int $size The max number of connections future pools will be able to |
51 | 51 | * create. Negative numbers mean that the pool will spawn an infinite number of |
52 | 52 | * connections |
53 | - * @return boolean Returns the former value of pool size |
|
53 | + * @return boolean|null Returns the former value of pool size |
|
54 | 54 | */ |
55 | 55 | public static function setSize($size) {} |
56 | 56 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * http://php.net/manual/en/mongoresultexception.getdocument.php |
26 | 26 | * @return array <p>The full result document as an array, including partial data if available and additional keys.</p> |
27 | 27 | */ |
28 | - public function getDocument () {} |
|
28 | + public function getDocument() {} |
|
29 | 29 | |
30 | 30 | public $document; |
31 | 31 |