@@ -7,6 +7,9 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class Finder extends BaseFinder |
| 9 | 9 | { |
| 10 | + /** |
|
| 11 | + * @param \Clusterpoint\Instance\Service $collection |
|
| 12 | + */ |
|
| 10 | 13 | protected function setLimit($collection) |
| 11 | 14 | { |
| 12 | 15 | if ($this->limit !== null) { |
@@ -14,6 +17,9 @@ discard block |
||
| 14 | 17 | } |
| 15 | 18 | } |
| 16 | 19 | |
| 20 | + /** |
|
| 21 | + * @param \Clusterpoint\Instance\Service $collection |
|
| 22 | + */ |
|
| 17 | 23 | protected function setOffset($collection) |
| 18 | 24 | { |
| 19 | 25 | if ($this->offset !== null) { |
@@ -21,6 +27,9 @@ discard block |
||
| 21 | 27 | } |
| 22 | 28 | } |
| 23 | 29 | |
| 30 | + /** |
|
| 31 | + * @param \Clusterpoint\Instance\Service $collection |
|
| 32 | + */ |
|
| 24 | 33 | protected function setOrderBy($collection) |
| 25 | 34 | { |
| 26 | 35 | foreach ($this->orderBy as $orderBy) { |
@@ -28,6 +37,9 @@ discard block |
||
| 28 | 37 | } |
| 29 | 38 | } |
| 30 | 39 | |
| 40 | + /** |
|
| 41 | + * @param \Clusterpoint\Instance\Service $collection |
|
| 42 | + */ |
|
| 31 | 43 | protected function setSelect($collection) |
| 32 | 44 | { |
| 33 | 45 | if ($this->select !== '*') { |
@@ -35,6 +47,9 @@ discard block |
||
| 35 | 47 | } |
| 36 | 48 | } |
| 37 | 49 | |
| 50 | + /** |
|
| 51 | + * @param \Clusterpoint\Instance\Service $collection |
|
| 52 | + */ |
|
| 38 | 53 | public function setWhere($collection) |
| 39 | 54 | { |
| 40 | 55 | if (!empty($this->where)) { |
@@ -81,6 +96,9 @@ discard block |
||
| 81 | 96 | }; |
| 82 | 97 | } |
| 83 | 98 | |
| 99 | + /** |
|
| 100 | + * @param string $nextLogical |
|
| 101 | + */ |
|
| 84 | 102 | protected function parseWhereGroup($logical, $collection, $condition, $nextLogical) |
| 85 | 103 | { |
| 86 | 104 | if ($logical === '||') { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | ['type' => get_class($this->client)] |
| 51 | 51 | ); |
| 52 | 52 | } |
| 53 | - $collection = $this->client->database($this->databaseName.'.'.$this->from); |
|
| 53 | + $collection = $this->client->database($this->databaseName . '.' . $this->from); |
|
| 54 | 54 | $this->setLimit($collection); |
| 55 | 55 | $this->setOffset($collection); |
| 56 | 56 | $this->setOrderBy($collection); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->setWhere($collection); |
| 59 | 59 | $items = json_decode(json_encode($collection->get()->toArray())); |
| 60 | 60 | $c = count($items); |
| 61 | - for ($i=0; $i<$c; $i++) { |
|
| 61 | + for ($i = 0; $i < $c; $i++) { |
|
| 62 | 62 | $this->resultSet[] = $items[$i]; |
| 63 | 63 | } |
| 64 | 64 | return $this; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @codeCoverageIgnore |
| 77 | 77 | * Passing anonymous function to Clusterpoint API |
| 78 | 78 | */ |
| 79 | - return function ($collection) use ($conditions, $logical) { |
|
| 79 | + return function($collection) use ($conditions, $logical) { |
|
| 80 | 80 | $this->parseWhere($collection, $conditions, $logical); |
| 81 | 81 | }; |
| 82 | 82 | } |