@@ -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) |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | { |
| 49 | 49 | if ($value instanceof ObjectID || $value instanceof MongoId) { |
| 50 | 50 | return true; |
| 51 | - } elseif (! is_string($value)) { |
|
| 51 | + } elseif ( ! is_string($value)) { |
|
| 52 | 52 | return false; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public static function get($db, $ref) |
| 79 | 79 | { |
| 80 | - if (! static::isRef($ref)) { |
|
| 80 | + if ( ! static::isRef($ref)) { |
|
| 81 | 81 | return null; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (! preg_match('#^/(.*)/([imxslu]*)$#', $regex, $matches)) { |
|
| 46 | + if ( ! preg_match('#^/(.*)/([imxslu]*)$#', $regex, $matches)) { |
|
| 47 | 47 | throw new MongoException('invalid regex', 9); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * |
| 36 | 36 | * @link http://php.net/manual/en/mongopool.setsize.php |
| 37 | 37 | * @param int $size |
| 38 | - * @return boolean Returns the former value of pool size |
|
| 38 | + * @return integer Returns the former value of pool size |
|
| 39 | 39 | */ |
| 40 | 40 | public static function setSize($size) |
| 41 | 41 | { |
@@ -65,6 +65,6 @@ |
||
| 65 | 65 | public function key() |
| 66 | 66 | { |
| 67 | 67 | $file = $this->current(); |
| 68 | - return ($file !== null) ? (string)$file->file['_id'] : null; |
|
| 68 | + return ($file !== null) ? (string) $file->file['_id'] : null; |
|
| 69 | 69 | } |
| 70 | 70 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | use Alcaeus\MongoDbAdapter\TypeConverter; |
| 17 | 17 | |
| 18 | -if (! function_exists('bson_decode')) { |
|
| 18 | +if ( ! function_exists('bson_decode')) { |
|
| 19 | 19 | /** |
| 20 | 20 | * Deserializes a BSON object into a PHP array |
| 21 | 21 | * |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -if (! function_exists('bson_encode')) { |
|
| 31 | +if ( ! function_exists('bson_encode')) { |
|
| 32 | 32 | /** |
| 33 | 33 | * Serializes a PHP variable into a BSON string |
| 34 | 34 | * |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ]; |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | - * @return Cursor |
|
| 83 | + * @return \Traversable |
|
| 84 | 84 | */ |
| 85 | 85 | abstract protected function ensureCursor(); |
| 86 | 86 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | /** |
| 380 | - * @return array |
|
| 380 | + * @return string[] |
|
| 381 | 381 | */ |
| 382 | 382 | public function __sleep() |
| 383 | 383 | { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function next() |
| 162 | 162 | { |
| 163 | - if (! $this->startedIterating) { |
|
| 163 | + if ( ! $this->startedIterating) { |
|
| 164 | 164 | $this->ensureIterator(); |
| 165 | 165 | $this->startedIterating = true; |
| 166 | 166 | } else { |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | */ |
| 403 | 403 | protected function storeIteratorState() |
| 404 | 404 | { |
| 405 | - if (! $this->startedIterating) { |
|
| 405 | + if ( ! $this->startedIterating) { |
|
| 406 | 406 | $this->current = null; |
| 407 | 407 | $this->key = null; |
| 408 | 408 | $this->valid = false; |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | - * @return array |
|
| 105 | + * @return string[] |
|
| 106 | 106 | */ |
| 107 | 107 | public function __sleep() |
| 108 | 108 | { |
@@ -511,6 +511,9 @@ discard block |
||
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | + /** |
|
| 515 | + * @param string $name |
|
| 516 | + */ |
|
| 514 | 517 | private function checkDatabaseName($name) |
| 515 | 518 | { |
| 516 | 519 | if (empty($name)) { |
@@ -543,7 +546,7 @@ discard block |
||
| 543 | 546 | } |
| 544 | 547 | |
| 545 | 548 | /** |
| 546 | - * @return array |
|
| 549 | + * @return string[] |
|
| 547 | 550 | */ |
| 548 | 551 | public function __sleep() |
| 549 | 552 | { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | throw ExceptionConverter::toLegacy($e); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $getCollectionInfo = function (CollectionInfo $collectionInfo) { |
|
| 145 | + $getCollectionInfo = function(CollectionInfo $collectionInfo) { |
|
| 146 | 146 | return [ |
| 147 | 147 | 'name' => $collectionInfo->getName(), |
| 148 | 148 | 'options' => $collectionInfo->getOptions(), |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | throw ExceptionConverter::toLegacy($e); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - $getCollectionName = function (CollectionInfo $collectionInfo) { |
|
| 182 | + $getCollectionName = function(CollectionInfo $collectionInfo) { |
|
| 183 | 183 | return $collectionInfo->getName(); |
| 184 | 184 | }; |
| 185 | 185 | |
@@ -348,13 +348,13 @@ discard block |
||
| 348 | 348 | if ($document_or_id instanceof \MongoId) { |
| 349 | 349 | $id = $document_or_id; |
| 350 | 350 | } elseif (is_object($document_or_id)) { |
| 351 | - if (! isset($document_or_id->_id)) { |
|
| 351 | + if ( ! isset($document_or_id->_id)) { |
|
| 352 | 352 | $id = $document_or_id; |
| 353 | 353 | } else { |
| 354 | 354 | $id = $document_or_id->_id; |
| 355 | 355 | } |
| 356 | 356 | } elseif (is_array($document_or_id)) { |
| 357 | - if (! isset($document_or_id['_id'])) { |
|
| 357 | + if ( ! isset($document_or_id['_id'])) { |
|
| 358 | 358 | return null; |
| 359 | 359 | } |
| 360 | 360 | |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | */ |
| 543 | 543 | private function getSystemCollectionFilterClosure($includeSystemCollections = false) |
| 544 | 544 | { |
| 545 | - return function (CollectionInfo $collectionInfo) use ($includeSystemCollections) { |
|
| 545 | + return function(CollectionInfo $collectionInfo) use ($includeSystemCollections) { |
|
| 546 | 546 | return $includeSystemCollections || ! preg_match('#^system\.#', $collectionInfo->getName()); |
| 547 | 547 | }; |
| 548 | 548 | } |