@@ -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 | } |
@@ -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 |
@@ -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 |
@@ -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 | } |
@@ -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 |
@@ -18,13 +18,16 @@ |
||
18 | 18 | * @link http://php.net/manual/en/class.mongoresultexception.php#mongoresultexception.props.document |
19 | 19 | * |
20 | 20 | */ |
21 | -class MongoResultException extends MongoException { |
|
21 | +class MongoResultException extends MongoException |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * Retrieve the full result document |
24 | 25 | * http://php.net/manual/en/mongoresultexception.getdocument.php |
25 | 26 | * @return array <p>The full result document as an array, including partial data if available and additional keys.</p> |
26 | 27 | */ |
27 | - public function getDocument () {} |
|
28 | + public function getDocument () |
|
29 | + { |
|
30 | +} |
|
28 | 31 | |
29 | 32 | public $document; |
30 | 33 |
@@ -15,7 +15,6 @@ |
||
15 | 15 | |
16 | 16 | use Alcaeus\MongoDbAdapter\TypeInterface; |
17 | 17 | use MongoDB\BSON\Binary; |
18 | -use MongoDB\BSON\Type; |
|
19 | 18 | |
20 | 19 | class MongoBinData implements TypeInterface |
21 | 20 | { |
@@ -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 | { |
@@ -15,7 +15,6 @@ |
||
15 | 15 | |
16 | 16 | use Alcaeus\MongoDbAdapter\AbstractCursor; |
17 | 17 | use MongoDB\Driver\Cursor; |
18 | -use MongoDB\Driver\ReadPreference; |
|
19 | 18 | use MongoDB\Operation\Find; |
20 | 19 | |
21 | 20 | /** |
@@ -380,7 +380,7 @@ |
||
380 | 380 | */ |
381 | 381 | protected function convertCursorType() |
382 | 382 | { |
383 | - if (! $this->tailable) { |
|
383 | + if ( ! $this->tailable) { |
|
384 | 384 | return null; |
385 | 385 | } |
386 | 386 |