Skip to content

Commit ab5b384

Browse files
committed
Reformat and FIX
1 parent b0e2a18 commit ab5b384

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

src/Jenssegers/Mongodb/Eloquent/Builder.php

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class Builder extends EloquentBuilder
2020
/**
2121
* Update a record in the database.
2222
*
23-
* @param array $values
24-
* @param array $options
23+
* @param array $values
24+
* @param array $options
2525
* @return int
2626
*/
2727
public function update(array $values, array $options = [])
@@ -40,7 +40,7 @@ public function update(array $values, array $options = [])
4040
/**
4141
* Insert a new record into the database.
4242
*
43-
* @param array $values
43+
* @param array $values
4444
* @return bool
4545
*/
4646
public function insert(array $values)
@@ -59,8 +59,8 @@ public function insert(array $values)
5959
/**
6060
* Insert a new record and get the value of the primary key.
6161
*
62-
* @param array $values
63-
* @param string $sequence
62+
* @param array $values
63+
* @param string $sequence
6464
* @return int
6565
*/
6666
public function insertGetId(array $values, $sequence = null)
@@ -97,9 +97,9 @@ public function delete()
9797
/**
9898
* Increment a column's value by a given amount.
9999
*
100-
* @param string $column
101-
* @param int $amount
102-
* @param array $extra
100+
* @param string $column
101+
* @param int $amount
102+
* @param array $extra
103103
* @return int
104104
*/
105105
public function increment($column, $amount = 1, array $extra = [])
@@ -127,9 +127,9 @@ public function increment($column, $amount = 1, array $extra = [])
127127
/**
128128
* Decrement a column's value by a given amount.
129129
*
130-
* @param string $column
131-
* @param int $amount
132-
* @param array $extra
130+
* @param string $column
131+
* @param int $amount
132+
* @param array $extra
133133
* @return int
134134
*/
135135
public function decrement($column, $amount = 1, array $extra = [])
@@ -155,11 +155,11 @@ public function decrement($column, $amount = 1, array $extra = [])
155155
/**
156156
* Add the "has" condition where clause to the query.
157157
*
158-
* @param \Illuminate\Database\Eloquent\Builder $hasQuery
159-
* @param \Illuminate\Database\Eloquent\Relations\Relation $relation
160-
* @param string $operator
161-
* @param int $count
162-
* @param string $boolean
158+
* @param \Illuminate\Database\Eloquent\Builder $hasQuery
159+
* @param \Illuminate\Database\Eloquent\Relations\Relation $relation
160+
* @param string $operator
161+
* @param int $count
162+
* @param string $boolean
163163
* @return \Illuminate\Database\Eloquent\Builder
164164
*/
165165
protected function addHasWhere(EloquentBuilder $hasQuery, Relation $relation, $operator, $count, $boolean)
@@ -168,7 +168,7 @@ protected function addHasWhere(EloquentBuilder $hasQuery, Relation $relation, $o
168168

169169
// Get the number of related objects for each possible parent.
170170
$relationCount = array_count_values(array_map(function ($id) {
171-
return (string) $id; // Convert Back ObjectIds to Strings
171+
return (string)$id; // Convert Back ObjectIds to Strings
172172
}, $query->pluck($relation->getHasCompareKey())));
173173

174174
// Remove unwanted related objects based on the operator and count.
@@ -209,7 +209,7 @@ protected function addHasWhere(EloquentBuilder $hasQuery, Relation $relation, $o
209209
/**
210210
* Create a raw database expression.
211211
*
212-
* @param closure $expression
212+
* @param closure $expression
213213
* @return mixed
214214
*/
215215
public function raw($expression = null)
@@ -221,13 +221,17 @@ public function raw($expression = null)
221221
if ($results instanceof Cursor) {
222222
$results = iterator_to_array($results, false);
223223
return $this->model->hydrate($results);
224-
} // Convert Mongo BSONDocument to a single object.
224+
}
225+
226+
// Convert Mongo BSONDocument to a single object.
225227
elseif ($results instanceof BSONDocument) {
226228
$results = $results->getArrayCopy();
227-
return $this->model->newFromBuilder((array) $results);
228-
} // The result is a single object.
229+
return $this->model->newFromBuilder((array)$results);
230+
}
231+
232+
// The result is a single object.
229233
elseif (is_array($results) and array_key_exists('_id', $results)) {
230-
return $this->model->newFromBuilder((array) $results);
234+
return $this->model->newFromBuilder((array)$results);
231235
}
232236

233237
return $results;

0 commit comments

Comments
 (0)