@@ -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 |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14 | 14 | */ |
15 | 15 | |
16 | -class MongoGridFS extends MongoCollection { |
|
16 | +class MongoGridFS extends MongoCollection |
|
17 | +{ |
|
17 | 18 | const ASCENDING = 1; |
18 | 19 | const DESCENDING = -1; |
19 | 20 | |
@@ -48,14 +49,18 @@ discard block |
||
48 | 49 | * @param mixed $chunks [optional] |
49 | 50 | * @return MongoGridFS |
50 | 51 | */ |
51 | - public function __construct($db, $prefix = "fs", $chunks = "fs") {} |
|
52 | + public function __construct($db, $prefix = "fs", $chunks = "fs") |
|
53 | + { |
|
54 | +} |
|
52 | 55 | |
53 | 56 | /** |
54 | 57 | * Drops the files and chunks collections |
55 | 58 | * @link http://php.net/manual/en/mongogridfs.drop.php |
56 | 59 | * @return array The database response |
57 | 60 | */ |
58 | - public function drop() {} |
|
61 | + public function drop() |
|
62 | + { |
|
63 | +} |
|
59 | 64 | |
60 | 65 | /** |
61 | 66 | * @link http://php.net/manual/en/mongogridfs.find.php |
@@ -63,7 +68,9 @@ discard block |
||
63 | 68 | * @param array $fields Fields to return |
64 | 69 | * @return MongoGridFSCursor A MongoGridFSCursor |
65 | 70 | */ |
66 | - public function find(array $query = array(), array $fields = array()) {} |
|
71 | + public function find(array $query = array(), array $fields = array()) |
|
72 | + { |
|
73 | +} |
|
67 | 74 | |
68 | 75 | /** |
69 | 76 | * Stores a file in the database |
@@ -73,7 +80,9 @@ discard block |
||
73 | 80 | * @param array $options Options for the store. "safe": Check that this store succeeded |
74 | 81 | * @return mixed Returns the _id of the saved object |
75 | 82 | */ |
76 | - public function storeFile($filename, $extra = array(), $options = array()) {} |
|
83 | + public function storeFile($filename, $extra = array(), $options = array()) |
|
84 | + { |
|
85 | +} |
|
77 | 86 | |
78 | 87 | /** |
79 | 88 | * Chunkifies and stores bytes in the database |
@@ -83,7 +92,9 @@ discard block |
||
83 | 92 | * @param array $options Options for the store. "safe": Check that this store succeeded |
84 | 93 | * @return mixed The _id of the object saved |
85 | 94 | */ |
86 | - public function storeBytes($bytes, $extra = array(), $options = array()) {} |
|
95 | + public function storeBytes($bytes, $extra = array(), $options = array()) |
|
96 | + { |
|
97 | +} |
|
87 | 98 | |
88 | 99 | /** |
89 | 100 | * Returns a single file matching the criteria |
@@ -92,7 +103,9 @@ discard block |
||
92 | 103 | * @param array $fields Fields of the results to return. |
93 | 104 | * @return MongoGridFSFile|null |
94 | 105 | */ |
95 | - public function findOne(array $query = array(), array $fields = array()) {} |
|
106 | + public function findOne(array $query = array(), array $fields = array()) |
|
107 | + { |
|
108 | +} |
|
96 | 109 | |
97 | 110 | /** |
98 | 111 | * Removes files from the collections |
@@ -102,7 +115,9 @@ discard block |
||
102 | 115 | * @throws MongoCursorException |
103 | 116 | * @return boolean |
104 | 117 | */ |
105 | - public function remove(array $criteria = array(), array $options = array()) {} |
|
118 | + public function remove(array $criteria = array(), array $options = array()) |
|
119 | + { |
|
120 | +} |
|
106 | 121 | |
107 | 122 | /** |
108 | 123 | * Delete a file from the database |
@@ -110,7 +125,9 @@ discard block |
||
110 | 125 | * @param mixed $id _id of the file to remove |
111 | 126 | * @return boolean Returns true if the remove was successfully sent to the database. |
112 | 127 | */ |
113 | - public function delete($id) {} |
|
128 | + public function delete($id) |
|
129 | + { |
|
130 | +} |
|
114 | 131 | |
115 | 132 | /** |
116 | 133 | * Saves an uploaded file directly from a POST to the database |
@@ -119,7 +136,9 @@ discard block |
||
119 | 136 | * @param array $metadata An array of extra fields for the uploaded file. |
120 | 137 | * @return mixed Returns the _id of the uploaded file. |
121 | 138 | */ |
122 | - public function storeUpload($name, array $metadata = array()) {} |
|
139 | + public function storeUpload($name, array $metadata = array()) |
|
140 | + { |
|
141 | +} |
|
123 | 142 | |
124 | 143 | |
125 | 144 | /** |
@@ -128,7 +147,9 @@ discard block |
||
128 | 147 | * @param mixed $id _id of the file to find. |
129 | 148 | * @return MongoGridFSFile|null Returns the file, if found, or NULL. |
130 | 149 | */ |
131 | - public function __get($id) {} |
|
150 | + public function __get($id) |
|
151 | + { |
|
152 | +} |
|
132 | 153 | |
133 | 154 | /** |
134 | 155 | * Stores a file in the database |
@@ -137,6 +158,8 @@ discard block |
||
137 | 158 | * @param array $extra Other metadata to add to the file saved |
138 | 159 | * @return mixed Returns the _id of the saved object |
139 | 160 | */ |
140 | - public function put($filename, array $extra = array()) {} |
|
161 | + public function put($filename, array $extra = array()) |
|
162 | + { |
|
163 | +} |
|
141 | 164 | |
142 | 165 | } |
@@ -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 |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14 | 14 | */ |
15 | 15 | |
16 | -class MongoLog { |
|
16 | +class MongoLog |
|
17 | +{ |
|
17 | 18 | /** |
18 | 19 | * @link http://php.net/manual/en/class.mongolog.php#mongolog.constants.none |
19 | 20 | */ |
@@ -99,7 +100,9 @@ discard block |
||
99 | 100 | * <ul> |
100 | 101 | * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
101 | 102 | */ |
102 | - public static function setCallback ( callable $log_function ) {} |
|
103 | + public static function setCallback ( callable $log_function ) |
|
104 | + { |
|
105 | +} |
|
103 | 106 | |
104 | 107 | /** |
105 | 108 | * This function can be used to set how verbose logging should be and the types of |
@@ -111,7 +114,9 @@ discard block |
||
111 | 114 | * @param int $level The levels you would like to log |
112 | 115 | * @return void |
113 | 116 | */ |
114 | - public static function setLevel($level) {} |
|
117 | + public static function setLevel($level) |
|
118 | + { |
|
119 | +} |
|
115 | 120 | |
116 | 121 | /** |
117 | 122 | * This can be used to see the log level. Use the constants described in the |
@@ -121,7 +126,9 @@ discard block |
||
121 | 126 | * @static |
122 | 127 | * @return int Returns the current level |
123 | 128 | */ |
124 | - public static function getLevel() {} |
|
129 | + public static function getLevel() |
|
130 | + { |
|
131 | +} |
|
125 | 132 | |
126 | 133 | /** |
127 | 134 | * This function can be used to set which parts of the driver's functionality |
@@ -133,7 +140,9 @@ discard block |
||
133 | 140 | * @param int $module The module(s) you would like to log |
134 | 141 | * @return void |
135 | 142 | */ |
136 | - public static function setModule($module) {} |
|
143 | + public static function setModule($module) |
|
144 | + { |
|
145 | +} |
|
137 | 146 | |
138 | 147 | /** |
139 | 148 | * This function can be used to see which parts of the driver's functionality are |
@@ -144,5 +153,7 @@ discard block |
||
144 | 153 | * @static |
145 | 154 | * @return int Returns the modules currently being logged |
146 | 155 | */ |
147 | - public static function getModule() {} |
|
156 | + public static function getModule() |
|
157 | + { |
|
158 | +} |
|
148 | 159 | } |
@@ -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 |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14 | 14 | */ |
15 | 15 | |
16 | -class MongoPool { |
|
16 | +class MongoPool |
|
17 | +{ |
|
17 | 18 | /** |
18 | 19 | * Returns an array of information about all connection pools. |
19 | 20 | * |
@@ -40,7 +41,9 @@ discard block |
||
40 | 41 | * keeps increasing, you may want to use MongoPool::setSize to add more connections |
41 | 42 | * to your pool |
42 | 43 | */ |
43 | - public static function info() {} |
|
44 | + public static function info() |
|
45 | + { |
|
46 | +} |
|
44 | 47 | |
45 | 48 | /** |
46 | 49 | * Sets the max number of connections new pools will be able to create. |
@@ -52,7 +55,9 @@ discard block |
||
52 | 55 | * connections |
53 | 56 | * @return boolean Returns the former value of pool size |
54 | 57 | */ |
55 | - public static function setSize($size) {} |
|
58 | + public static function setSize($size) |
|
59 | + { |
|
60 | +} |
|
56 | 61 | |
57 | 62 | /** |
58 | 63 | * . |
@@ -61,5 +66,7 @@ discard block |
||
61 | 66 | * @static |
62 | 67 | * @return int Returns the current pool size |
63 | 68 | */ |
64 | - public static function getSize() {} |
|
69 | + public static function getSize() |
|
70 | + { |
|
71 | +} |
|
65 | 72 | } |
@@ -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 | { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @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. |
273 | 273 | * @throws MongoCursorException if the "w" option is set and the write fails. |
274 | 274 | * @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. |
275 | - * @return bool|array Returns an array containing the status of the insertion if the "w" option is set. |
|
275 | + * @return MongoDB\InsertOneResult Returns an array containing the status of the insertion if the "w" option is set. |
|
276 | 276 | */ |
277 | 277 | public function insert($a, array $options = array()) |
278 | 278 | { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | * @param array $a An array of arrays. |
286 | 286 | * @param array $options Options for the inserts. |
287 | 287 | * @throws MongoCursorException |
288 | - * @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. |
|
288 | + * @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. |
|
289 | 289 | */ |
290 | 290 | public function batchInsert(array $a, array $options = array()) |
291 | 291 | { |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | * @link http://www.php.net/manual/en/mongocollection.createindex.php |
467 | 467 | * @param array $keys Field or fields to use as index. |
468 | 468 | * @param array $options [optional] This parameter is an associative array of the form array("optionname" => <boolean>, ...). |
469 | - * @return array Returns the database response. |
|
469 | + * @return string|false Returns the database response. |
|
470 | 470 | */ |
471 | 471 | public function createIndex(array $keys, array $options = array()) |
472 | 472 | { |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | * @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. |
560 | 560 | * @throws MongoCursorException if the "w" option is set and the write fails. |
561 | 561 | * @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. |
562 | - * @return array|boolean If w was set, returns an array containing the status of the save. |
|
562 | + * @return MongoDB\UpdateResult If w was set, returns an array containing the status of the save. |
|
563 | 563 | * Otherwise, returns a boolean representing if the array was not empty (an empty array will not be inserted). |
564 | 564 | */ |
565 | 565 | public function save($a, array $options = array()) |
@@ -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() |
@@ -13,6 +13,7 @@ |
||
13 | 13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14 | 14 | */ |
15 | 15 | |
16 | -class MongoConnectionException extends MongoException { |
|
16 | +class MongoConnectionException extends MongoException |
|
17 | +{ |
|
17 | 18 | |
18 | 19 | } |