@@ -84,7 +84,7 @@ |
||
| 84 | 84 | return $value->getValue(); |
| 85 | 85 | |
| 86 | 86 | case is_int($value) || ctype_digit($value): |
| 87 | - return (int) $value; |
|
| 87 | + return (int)$value; |
|
| 88 | 88 | |
| 89 | 89 | case is_float($value): |
| 90 | 90 | // Convert to non-locale aware float to prevent possible commas |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function getAllowedCount() |
| 27 | 27 | { |
| 28 | - return (int) $this->meta['total']; |
|
| 28 | + return (int)$this->meta['total']; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function getTotalCount() |
| 32 | 32 | { |
| 33 | - return (int) $this->meta['total_found']; |
|
| 33 | + return (int)$this->meta['total_found']; |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public function __construct(array $result, array $rawMeta) |
| 11 | 11 | { |
| 12 | - parent::__construct(array_map(function ($result) { |
|
| 12 | + parent::__construct(array_map(function($result) { |
|
| 13 | 13 | return new SimpleResultSet($result); |
| 14 | 14 | }, $result), $rawMeta); |
| 15 | 15 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | { |
| 70 | 70 | $this->initialize(); |
| 71 | 71 | |
| 72 | - if (false === $value = $this->pdo->quote((string) $value)) { |
|
| 72 | + if (false === $value = $this->pdo->quote((string)$value)) { |
|
| 73 | 73 | throw new ConnectionException($this->pdo->errorInfo(), $this->pdo->errorCode()); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | return $this; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - return $this->add('select', (array) $select); |
|
| 79 | + return $this->add('select', (array)$select); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function addSelect($select) |
| 83 | 83 | { |
| 84 | 84 | $this->type = self::TYPE_SELECT; |
| 85 | 85 | |
| 86 | - return $this->add('select', (array) $select, true); |
|
| 86 | + return $this->add('select', (array)$select, true); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | public function update($index) |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function facet($facet, $by = null, $order = null, $direction = null, $limit = null, $skip = 0) |
| 185 | 185 | { |
| 186 | - $facet = (array) $facet; |
|
| 186 | + $facet = (array)$facet; |
|
| 187 | 187 | |
| 188 | 188 | return $this->add('facet', compact('facet', 'by', 'order', 'direction', 'limit', 'skip'), true); |
| 189 | 189 | } |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | //TODO: inject limit, skip as parameters for better caching? Or just move caching to upper layer |
| 351 | 351 | if ($this->sqlParts['maxResults']) { |
| 352 | - $query .= ' LIMIT '.(int) $this->sqlParts['firstResult'].', '.(int) $this->sqlParts['maxResults']; |
|
| 352 | + $query .= ' LIMIT '.(int)$this->sqlParts['firstResult'].', '.(int)$this->sqlParts['maxResults']; |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | $query .= $this->buildOptionsPart() |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | $facetPart .= ' ORDER BY '.$facet['order'].$this->getDirection($facet['order'], $facet['direction']); |
| 485 | 485 | } |
| 486 | 486 | if ($facet['limit']) { |
| 487 | - $facetPart .= ' LIMIT '.(int) $facet['skip'].', '.(int) $facet['limit']; |
|
| 487 | + $facetPart .= ' LIMIT '.(int)$facet['skip'].', '.(int)$facet['limit']; |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | $facetParts[] = $facetPart; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $indexer = $this->getIndexer($index); |
| 35 | 35 | $range = array_replace($indexer->getRangeCriterias(), $rangeCriterias); |
| 36 | 36 | |
| 37 | - $reindexCallback = function ($data) use ($index, $indexer, $batchCallback, $range) { |
|
| 37 | + $reindexCallback = function($data) use ($index, $indexer, $batchCallback, $range) { |
|
| 38 | 38 | if (null !== $batchCallback) { |
| 39 | 39 | $batchCallback( |
| 40 | 40 | array( |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $indexer = $this->getIndexer($index); |
| 65 | 65 | |
| 66 | - $reindexItemsCallback = function ($itemsIdsToProcess) use ($index, $indexer) { |
|
| 66 | + $reindexItemsCallback = function($itemsIdsToProcess) use ($index, $indexer) { |
|
| 67 | 67 | $items = $indexer->getItemsByIds($itemsIdsToProcess); |
| 68 | 68 | $this->processItems($index, $indexer, $items); |
| 69 | 69 | }; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | public function removeItems($index, $itemsIds) |
| 78 | 78 | { |
| 79 | - $removeItemsCallback = function () use ($index, $itemsIds) { |
|
| 79 | + $removeItemsCallback = function() use ($index, $itemsIds) { |
|
| 80 | 80 | return $this->conn->createQueryBuilder() |
| 81 | 81 | ->delete($this->conn->getEscaper()->quoteIdentifier($index)) |
| 82 | 82 | ->where('id IN :ids') |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | public function getIndexRange($index) |
| 91 | 91 | { |
| 92 | - $getIndexRangeCallback = function () use ($index) { |
|
| 92 | + $getIndexRangeCallback = function() use ($index) { |
|
| 93 | 93 | return $this->conn |
| 94 | 94 | ->createQueryBuilder() |
| 95 | 95 | ->select('MIN(id) AS `min`, MAX(id) AS `max`') |