@@ -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 | } |
@@ -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 |
@@ -101,7 +101,7 @@ |
||
101 | 101 | * @param bool $ok |
102 | 102 | * @return bool returns the former value of slaveOkay for this instance. |
103 | 103 | */ |
104 | - public function setSlaveOkay ($ok) |
|
104 | + public function setSlaveOkay($ok) |
|
105 | 105 | { |
106 | 106 | $this->notImplemented(); |
107 | 107 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | protected function setWriteConcernFromParameters($wstring, $wtimeout = 0) |
57 | 57 | { |
58 | - if (! is_string($wstring) && ! is_int($wstring)) { |
|
58 | + if ( ! is_string($wstring) && ! is_int($wstring)) { |
|
59 | 59 | trigger_error("w for WriteConcern must be a string or integer", E_WARNING); |
60 | 60 | return false; |
61 | 61 | } |
@@ -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 |
@@ -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 |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function find(array $query = array(), array $fields = array()) |
93 | 93 | { |
94 | - $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string)$this, $query, $fields); |
|
94 | + $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string) $this, $query, $fields); |
|
95 | 95 | $cursor->setReadPreference($this->getReadPreference()); |
96 | 96 | |
97 | 97 | return $cursor; |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | $shortName = basename($filename); |
113 | 113 | $filename = fopen($filename, 'r'); |
114 | 114 | } |
115 | - if (! is_resource($filename)) { |
|
115 | + if ( ! is_resource($filename)) { |
|
116 | 116 | throw new \InvalidArgumentException(); |
117 | 117 | } |
118 | 118 | $length = fstat($filename)['size']; |
119 | - $extra['chunkSize'] = isset($extra['chunkSize']) ? $extra['chunkSize']: self::DEFAULT_CHUNK_SIZE; |
|
119 | + $extra['chunkSize'] = isset($extra['chunkSize']) ? $extra['chunkSize'] : self::DEFAULT_CHUNK_SIZE; |
|
120 | 120 | $extra['_id'] = isset($extra['_id']) ?: new MongoId(); |
121 | 121 | $extra['length'] = $length; |
122 | 122 | $extra['md5'] = isset($md5) ? $md5 : $this->calculateMD5($filename, $length); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | public function findOne(array $query = array(), array $fields = array()) |
217 | 217 | { |
218 | 218 | $file = parent::findOne($query, $fields); |
219 | - if (! $file) { |
|
219 | + if ( ! $file) { |
|
220 | 220 | return; |
221 | 221 | } |
222 | 222 | return new MongoGridFSFile($this, $file); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | if (is_string($id)) { |
253 | 253 | $id = new MongoId($id); |
254 | 254 | } |
255 | - if (! $id instanceof MongoId) { |
|
255 | + if ( ! $id instanceof MongoId) { |
|
256 | 256 | return false; |
257 | 257 | } |
258 | 258 | $this->chunks->remove(['file_id' => $id], ['justOne' => false]); |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function storeUpload($name, array $metadata = []) |
270 | 270 | { |
271 | - if (! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) { |
|
271 | + if ( ! isset($_FILES[$name]) || $_FILES[$name]['error'] !== UPLOAD_ERR_OK) { |
|
272 | 272 | throw new \InvalidArgumentException(); |
273 | 273 | } |
274 | 274 | $metadata += ['filename' => $_FILES[$name]['name']]; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | if (is_string($id)) { |
287 | 287 | $id = new MongoId($id); |
288 | 288 | } |
289 | - if (! $id instanceof MongoId) { |
|
289 | + if ( ! $id instanceof MongoId) { |
|
290 | 290 | return false; |
291 | 291 | } |
292 | 292 | return $this->findOne(['_id' => $id]); |