@@ -32,8 +32,7 @@ discard block |
||
| 32 | 32 | if ((int)$res->hits() > 0) { |
| 33 | 33 | $results = json_decode($res->rawResponse())->results; |
| 34 | 34 | $message = $results[0]->{$this->primaryKey} === $this->getPrimaryKeyValue() ? |
| 35 | - 'Primary key collision' : |
|
| 36 | - 'Unique constraint violation'; |
|
| 35 | + 'Primary key collision' : 'Unique constraint violation'; |
|
| 37 | 36 | throw new RestException( |
| 38 | 37 | $message, |
| 39 | 38 | ['resourceName' => $this->resourceName, 'confilct' => $results[0]] |
@@ -44,7 +43,7 @@ discard block |
||
| 44 | 43 | private function getUniqueFieldQuery($query, $uniqueFields) |
| 45 | 44 | { |
| 46 | 45 | // @codeCoverageIgnoreStart |
| 47 | - $query->where(function ($query) use ($uniqueFields) { |
|
| 46 | + $query->where(function($query) use ($uniqueFields) { |
|
| 48 | 47 | foreach ($uniqueFields as $fieldName) { |
| 49 | 48 | if (property_exists($this->resource, $fieldName)) { |
| 50 | 49 | $query->orWhere($fieldName, '==', $this->resource->{$fieldName}); |
@@ -57,7 +56,7 @@ discard block |
||
| 57 | 56 | |
| 58 | 57 | public function query() |
| 59 | 58 | { |
| 60 | - $query = $this->database->getClient()->database($this->database->getDatabaseName().'.'.$this->resourceName); |
|
| 59 | + $query = $this->database->getClient()->database($this->database->getDatabaseName() . '.' . $this->resourceName); |
|
| 61 | 60 | return $query; |
| 62 | 61 | } |
| 63 | 62 | } |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | ); |
| 61 | 61 | } |
| 62 | 62 | $collection = $this->client->database( |
| 63 | - $this->queryConfiguration->databaseName. |
|
| 64 | - '.'. |
|
| 63 | + $this->queryConfiguration->databaseName . |
|
| 64 | + '.' . |
|
| 65 | 65 | $this->queryConfiguration->from |
| 66 | 66 | ); |
| 67 | 67 | $this->configQuery($collection); |
| 68 | 68 | $items = json_decode(json_encode($collection->get()->toArray())); |
| 69 | 69 | $count = count($items); |
| 70 | - for ($idx=0; $idx<$count; $idx++) { |
|
| 70 | + for ($idx = 0; $idx < $count; $idx++) { |
|
| 71 | 71 | $this->resultSet[] = $items[$idx]; |
| 72 | 72 | } |
| 73 | 73 | return $this; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @codeCoverageIgnore |
| 86 | 86 | * Passing anonymous function to Clusterpoint API |
| 87 | 87 | */ |
| 88 | - return function ($collection) use ($conditions, $logical) { |
|
| 88 | + return function($collection) use ($conditions, $logical) { |
|
| 89 | 89 | $this->parseWhere($collection, $conditions, $logical); |
| 90 | 90 | }; |
| 91 | 91 | } |