@@ -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/> |
@@ -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 | } |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -377,7 +377,7 @@ |
||
377 | 377 | */ |
378 | 378 | protected function convertCursorType() |
379 | 379 | { |
380 | - if (! $this->tailable) { |
|
380 | + if (!$this->tailable) { |
|
381 | 381 | return null; |
382 | 382 | } |
383 | 383 |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function aggregate(array $pipeline, array $op = [] /* , array $pipelineOperators, ... */) |
107 | 107 | { |
108 | - if (! TypeConverter::isNumericArray($pipeline)) { |
|
108 | + if (!TypeConverter::isNumericArray($pipeline)) { |
|
109 | 109 | $pipeline = []; |
110 | 110 | $options = []; |
111 | 111 | |
112 | 112 | $i = 0; |
113 | 113 | foreach (func_get_args() as $operator) { |
114 | 114 | $i++; |
115 | - if (! is_array($operator)) { |
|
115 | + if (!is_array($operator)) { |
|
116 | 116 | trigger_error("Argument $i is not an array", E_WARNING); |
117 | 117 | return; |
118 | 118 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | ]; |
149 | 149 | |
150 | 150 | // Convert cursor option |
151 | - if (! isset($options['cursor']) || $options['cursor'] === true || $options['cursor'] === []) { |
|
151 | + if (!isset($options['cursor']) || $options['cursor'] === true || $options['cursor'] === []) { |
|
152 | 152 | // Cursor option needs to be an object convert bools and empty arrays since those won't be handled by TypeConverter |
153 | 153 | $options['cursor'] = new \stdClass; |
154 | 154 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | * @throws MongoCursorException |
285 | 285 | * @return boolean |
286 | 286 | */ |
287 | - public function update(array $criteria , array $newobj, array $options = array()) |
|
287 | + public function update(array $criteria, array $newobj, array $options = array()) |
|
288 | 288 | { |
289 | 289 | $multiple = ($options['multiple']) ? $options['multiple'] : false; |
290 | 290 | // $multiple = $options['multiple'] ?? false; |