@@ -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 | } |
@@ -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 |
@@ -119,7 +119,7 @@ |
||
119 | 119 | * <ul> |
120 | 120 | * @return boolean Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
121 | 121 | */ |
122 | - public static function setCallback(callable $log_function ) |
|
122 | + public static function setCallback(callable $log_function) |
|
123 | 123 | { |
124 | 124 | self::$callback = $log_function; |
125 | 125 | return true; |
@@ -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 | * |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | use Helper\WriteConcern; |
29 | 29 | |
30 | 30 | const VERSION = '1.6.12'; |
31 | - const DEFAULT_HOST = "localhost" ; |
|
32 | - const DEFAULT_PORT = 27017 ; |
|
33 | - const RP_PRIMARY = "primary" ; |
|
34 | - const RP_PRIMARY_PREFERRED = "primaryPreferred" ; |
|
35 | - const RP_SECONDARY = "secondary" ; |
|
36 | - const RP_SECONDARY_PREFERRED = "secondaryPreferred" ; |
|
37 | - const RP_NEAREST = "nearest" ; |
|
31 | + const DEFAULT_HOST = "localhost"; |
|
32 | + const DEFAULT_PORT = 27017; |
|
33 | + const RP_PRIMARY = "primary"; |
|
34 | + const RP_PRIMARY_PREFERRED = "primaryPreferred"; |
|
35 | + const RP_SECONDARY = "secondary"; |
|
36 | + const RP_SECONDARY_PREFERRED = "secondaryPreferred"; |
|
37 | + const RP_NEAREST = "nearest"; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * @var bool |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | $this->server = $server; |
86 | 86 | if (false === strpos($this->server, 'mongodb://')) { |
87 | - $this->server = 'mongodb://'.$this->server; |
|
87 | + $this->server = 'mongodb://' . $this->server; |
|
88 | 88 | } |
89 | 89 | $this->client = new Client($this->server, $options, $driverOptions); |
90 | 90 | $info = $this->client->__debugInfo(); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param int|MongoInt64 $id The ID of the cursor to kill. |
231 | 231 | * @return bool |
232 | 232 | */ |
233 | - public function killCursor($server_hash , $id) |
|
233 | + public function killCursor($server_hash, $id) |
|
234 | 234 | { |
235 | 235 | $this->notImplemented(); |
236 | 236 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | throw ExceptionConverter::toLegacy($e); |
139 | 139 | } |
140 | 140 | |
141 | - $getCollectionInfo = function (CollectionInfo $collectionInfo) { |
|
141 | + $getCollectionInfo = function(CollectionInfo $collectionInfo) { |
|
142 | 142 | return [ |
143 | 143 | 'name' => $collectionInfo->getName(), |
144 | 144 | 'options' => $collectionInfo->getOptions(), |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | throw ExceptionConverter::toLegacy($e); |
176 | 176 | } |
177 | 177 | |
178 | - $getCollectionName = function (CollectionInfo $collectionInfo) { |
|
178 | + $getCollectionName = function(CollectionInfo $collectionInfo) { |
|
179 | 179 | return $collectionInfo->getName(); |
180 | 180 | }; |
181 | 181 | |
@@ -344,13 +344,13 @@ discard block |
||
344 | 344 | if ($document_or_id instanceof \MongoId) { |
345 | 345 | $id = $document_or_id; |
346 | 346 | } elseif (is_object($document_or_id)) { |
347 | - if (! isset($document_or_id->_id)) { |
|
347 | + if ( ! isset($document_or_id->_id)) { |
|
348 | 348 | $id = $document_or_id; |
349 | 349 | } else { |
350 | 350 | $id = $document_or_id->_id; |
351 | 351 | } |
352 | 352 | } elseif (is_array($document_or_id)) { |
353 | - if (! isset($document_or_id['_id'])) { |
|
353 | + if ( ! isset($document_or_id['_id'])) { |
|
354 | 354 | return null; |
355 | 355 | } |
356 | 356 | |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * @return Closure |
542 | 542 | */ |
543 | 543 | private function getSystemCollectionFilterClosure($includeSystemCollections = false) { |
544 | - return function (CollectionInfo $collectionInfo) use ($includeSystemCollections) { |
|
544 | + return function(CollectionInfo $collectionInfo) use ($includeSystemCollections) { |
|
545 | 545 | return $includeSystemCollections || ! preg_match('#^system\.#', $collectionInfo->getName()); |
546 | 546 | }; |
547 | 547 | } |