@@ -21,7 +21,7 @@ class Connection extends \Illuminate\Database\Connection
21
21
/**
22
22
* Create a new database connection instance.
23
23
*
24
- * @param array $config
24
+ * @param array $config
25
25
*/
26
26
public function __construct (array $ config )
27
27
{
@@ -45,9 +45,7 @@ public function __construct(array $config)
45
45
}
46
46
47
47
/**
48
- * Get the default post processor instance.
49
- *
50
- * @return Query\Processor
48
+ * @inheritdoc
51
49
*/
52
50
protected function getDefaultPostProcessor ()
53
51
{
@@ -57,7 +55,7 @@ protected function getDefaultPostProcessor()
57
55
/**
58
56
* Begin a fluent query against a database collection.
59
57
*
60
- * @param string $collection
58
+ * @param string $collection
61
59
* @return Query\Builder
62
60
*/
63
61
public function collection ($ collection )
@@ -72,7 +70,7 @@ public function collection($collection)
72
70
/**
73
71
* Begin a fluent query against a database collection.
74
72
*
75
- * @param string $table
73
+ * @param string $table
76
74
* @return Query\Builder
77
75
*/
78
76
public function table ($ table )
@@ -83,7 +81,7 @@ public function table($table)
83
81
/**
84
82
* Get a MongoDB collection.
85
83
*
86
- * @param string $name
84
+ * @param string $name
87
85
* @return Collection
88
86
*/
89
87
public function getCollection ($ name )
@@ -92,9 +90,7 @@ public function getCollection($name)
92
90
}
93
91
94
92
/**
95
- * Get a schema builder instance for the connection.
96
- *
97
- * @return Schema\Builder
93
+ * @inheritdoc
98
94
*/
99
95
public function getSchemaBuilder ()
100
96
{
@@ -124,9 +120,9 @@ public function getMongoClient()
124
120
/**
125
121
* Create a new MongoDB connection.
126
122
*
127
- * @param string $dsn
128
- * @param array $config
129
- * @param array $options
123
+ * @param string $dsn
124
+ * @param array $config
125
+ * @param array $options
130
126
* @return \MongoDB\Client
131
127
*/
132
128
protected function createConnection ($ dsn , array $ config , array $ options )
@@ -139,18 +135,18 @@ protected function createConnection($dsn, array $config, array $options)
139
135
}
140
136
141
137
// Check if the credentials are not already set in the options
142
- if (!isset ($ options ['username ' ]) && !empty ($ config ['username ' ])) {
138
+ if (! isset ($ options ['username ' ]) && ! empty ($ config ['username ' ])) {
143
139
$ options ['username ' ] = $ config ['username ' ];
144
140
}
145
- if (!isset ($ options ['password ' ]) && !empty ($ config ['password ' ])) {
141
+ if (! isset ($ options ['password ' ]) && ! empty ($ config ['password ' ])) {
146
142
$ options ['password ' ] = $ config ['password ' ];
147
143
}
148
144
149
145
return new Client ($ dsn , $ options , $ driverOptions );
150
146
}
151
147
152
148
/**
153
- * Disconnect from the underlying MongoDB connection.
149
+ * @inheritdoc
154
150
*/
155
151
public function disconnect ()
156
152
{
@@ -160,7 +156,7 @@ public function disconnect()
160
156
/**
161
157
* Create a DSN string from a configuration.
162
158
*
163
- * @param array $config
159
+ * @param array $config
164
160
* @return string
165
161
*/
166
162
protected function getDsn (array $ config )
@@ -176,41 +172,34 @@ protected function getDsn(array $config)
176
172
foreach ($ hosts as &$ host ) {
177
173
// Check if we need to add a port to the host
178
174
if (strpos ($ host , ': ' ) === false && ! empty ($ config ['port ' ])) {
179
- $ host = $ host . ': ' . $ config ['port ' ];
175
+ $ host = $ host. ': ' . $ config ['port ' ];
180
176
}
181
177
}
182
178
183
179
// Check if we want to authenticate against a specific database.
184
180
$ auth_database = isset ($ config ['options ' ]) && ! empty ($ config ['options ' ]['database ' ]) ? $ config ['options ' ]['database ' ] : null ;
185
181
186
- return 'mongodb:// ' . implode (', ' , $ hosts ) . ($ auth_database ? '/ ' . $ auth_database : '' );
182
+ return 'mongodb:// ' . implode (', ' , $ hosts ). ($ auth_database ? '/ ' . $ auth_database : '' );
187
183
}
188
184
189
185
/**
190
- * Get the elapsed time since a given starting point.
191
- *
192
- * @param int $start
193
- * @return float
186
+ * @inheritdoc
194
187
*/
195
188
public function getElapsedTime ($ start )
196
189
{
197
190
return parent ::getElapsedTime ($ start );
198
191
}
199
192
200
193
/**
201
- * Get the PDO driver name.
202
- *
203
- * @return string
194
+ * @inheritdoc
204
195
*/
205
196
public function getDriverName ()
206
197
{
207
198
return 'mongodb ' ;
208
199
}
209
200
210
201
/**
211
- * Get the default schema grammar instance.
212
- *
213
- * @return Schema\Grammar
202
+ * @inheritdoc
214
203
*/
215
204
protected function getDefaultSchemaGrammar ()
216
205
{
@@ -220,8 +209,8 @@ protected function getDefaultSchemaGrammar()
220
209
/**
221
210
* Dynamically pass methods to the connection.
222
211
*
223
- * @param string $method
224
- * @param array $parameters
212
+ * @param string $method
213
+ * @param array $parameters
225
214
* @return mixed
226
215
*/
227
216
public function __call ($ method , $ parameters )
0 commit comments