@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param int $limit The number of Models to limit. |
| 84 | 84 | * @return \Doctrine\MongoDB\Cursor |
| 85 | 85 | */ |
| 86 | - public function executeFind(EntityMetadata $metadata, Store $store, array $criteria, array $fields = [], array $sort = [], $offset = 0, $limit = 0) |
|
| 86 | + public function executeFind(EntityMetadata $metadata, Store $store, array $criteria, array $fields = [ ], array $sort = [ ], $offset = 0, $limit = 0) |
|
| 87 | 87 | { |
| 88 | 88 | $criteria = $this->getFormatter()->formatQuery($metadata, $store, $criteria); |
| 89 | 89 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | ]; |
| 163 | 163 | if (true === $related->isChildEntity()) { |
| 164 | 164 | // The relationship is owned by a polymorphic model. Must include the type in the root criteria. |
| 165 | - $criteria[Persister::POLYMORPHIC_KEY] = $related->type; |
|
| 165 | + $criteria[ Persister::POLYMORPHIC_KEY ] = $related->type; |
|
| 166 | 166 | } |
| 167 | 167 | return $criteria; |
| 168 | 168 | } |
@@ -190,18 +190,18 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function getRetrieveCritiera(EntityMetadata $metadata, $identifiers = null) |
| 192 | 192 | { |
| 193 | - $criteria = []; |
|
| 193 | + $criteria = [ ]; |
|
| 194 | 194 | if (true === $metadata->isChildEntity()) { |
| 195 | - $criteria[Persister::POLYMORPHIC_KEY] = $metadata->type; |
|
| 195 | + $criteria[ Persister::POLYMORPHIC_KEY ] = $metadata->type; |
|
| 196 | 196 | } elseif (true === $metadata->isPolymorphic() && false === $metadata->isAbstract()) { |
| 197 | - $criteria[Persister::POLYMORPHIC_KEY] = $metadata->type; |
|
| 197 | + $criteria[ Persister::POLYMORPHIC_KEY ] = $metadata->type; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | $identifiers = (array) $identifiers; |
| 201 | 201 | if (empty($identifiers)) { |
| 202 | 202 | return $criteria; |
| 203 | 203 | } |
| 204 | - $criteria[Persister::IDENTIFIER_KEY] = (1 === count($identifiers)) ? reset($identifiers) : $identifiers; |
|
| 204 | + $criteria[ Persister::IDENTIFIER_KEY ] = (1 === count($identifiers)) ? reset($identifiers) : $identifiers; |
|
| 205 | 205 | return $criteria; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | private function isSearchQuery(array $criteria) |
| 287 | 287 | { |
| 288 | - if (isset($criteria['$text'])) { |
|
| 288 | + if (isset($criteria[ '$text' ])) { |
|
| 289 | 289 | return true; |
| 290 | 290 | } |
| 291 | 291 | foreach ($criteria as $key => $value) { |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | if ($type !== $include) { |
| 315 | 315 | PersisterException::badRequest('Field projection mismatch. You cannot both exclude and include fields.'); |
| 316 | 316 | } |
| 317 | - $fields[$key] = $type; |
|
| 317 | + $fields[ $key ] = $type; |
|
| 318 | 318 | } |
| 319 | - return [$fields, $include]; |
|
| 319 | + return [ $fields, $include ]; |
|
| 320 | 320 | } |
| 321 | 321 | } |