@@ -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 |
@@ -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 |
@@ -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 | /** |
@@ -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()) |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @link http://php.net/manual/en/mongogridfs.construct.php |
52 | 52 | * @param MongoDB $db Database |
53 | 53 | * @param string $prefix [optional] <p>Optional collection name prefix.</p> |
54 | - * @param mixed $chunks [optional] |
|
54 | + * @param string $chunks [optional] |
|
55 | 55 | * @return MongoGridFS |
56 | 56 | */ |
57 | 57 | public function __construct(MongoDB $db, $prefix = "fs", $chunks = null) |
@@ -128,6 +128,9 @@ discard block |
||
128 | 128 | return $fileDocument['_id']; |
129 | 129 | } |
130 | 130 | |
131 | + /** |
|
132 | + * @param resource $file |
|
133 | + */ |
|
131 | 134 | private function insertChunksFromFile($file, $fileInfo) |
132 | 135 | { |
133 | 136 | $length = $fileInfo['length']; |
@@ -143,6 +146,9 @@ discard block |
||
143 | 146 | } |
144 | 147 | } |
145 | 148 | |
149 | + /** |
|
150 | + * @param resource $file |
|
151 | + */ |
|
146 | 152 | private function calculateMD5($file, $length) |
147 | 153 | { |
148 | 154 | // XXX: this could be really a bad idea with big files... |
@@ -180,6 +186,9 @@ discard block |
||
180 | 186 | return $metadata; |
181 | 187 | } |
182 | 188 | |
189 | + /** |
|
190 | + * @param string $bytes |
|
191 | + */ |
|
183 | 192 | private function insertChunksFromBytes($bytes, $fileInfo) |
184 | 193 | { |
185 | 194 | $length = $fileInfo['length']; |
@@ -195,6 +204,10 @@ discard block |
||
195 | 204 | } |
196 | 205 | } |
197 | 206 | |
207 | + /** |
|
208 | + * @param string $data |
|
209 | + * @param integer $chunkNumber |
|
210 | + */ |
|
198 | 211 | private function insertChunk($id, $data, $chunkNumber) |
199 | 212 | { |
200 | 213 | $chunk = [ |
@@ -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 |
@@ -13,8 +13,6 @@ |
||
13 | 13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14 | 14 | */ |
15 | 15 | |
16 | -use Alcaeus\MongoDbAdapter\TypeConverter; |
|
17 | - |
|
18 | 16 | class MongoGridFSFile { |
19 | 17 | /** |
20 | 18 | * @link http://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.file |