Completed
Push — master ( 03c777...ad4614 )
by Konstantin
05:46
created
QueryBuilder.php 2 patches
Doc Comments   +15 added lines patch added patch discarded remove patch
@@ -69,6 +69,9 @@  discard block
 block discarded – undo
69 69
         return $this->conn->getEscaper();
70 70
     }
71 71
 
72
+    /**
73
+     * @param string $select
74
+     */
72 75
     public function select($select = null)
73 76
     {
74 77
         $this->type = self::TYPE_SELECT;
@@ -100,6 +103,9 @@  discard block
 block discarded – undo
100 103
         return $this->add('from', array('table' => $index));
101 104
     }
102 105
 
106
+    /**
107
+     * @param string $index
108
+     */
103 109
     public function replace($index)
104 110
     {
105 111
         $this->type = self::TYPE_REPLACE;
@@ -107,6 +113,9 @@  discard block
 block discarded – undo
107 113
         return $this->add('from', array('table' => $index));
108 114
     }
109 115
 
116
+    /**
117
+     * @param string $index
118
+     */
110 119
     public function delete($index)
111 120
     {
112 121
         $this->type = self::TYPE_DELETE;
@@ -129,6 +138,9 @@  discard block
 block discarded – undo
129 138
         return $this->add('values', $values, true);
130 139
     }
131 140
 
141
+    /**
142
+     * @param string $index
143
+     */
132 144
     public function from($index)
133 145
     {
134 146
         return $this->add('from', array('table' => $index));
@@ -139,6 +151,9 @@  discard block
 block discarded – undo
139 151
         return $this->add('from', array('table' => $index), true);
140 152
     }
141 153
 
154
+    /**
155
+     * @param string $where
156
+     */
142 157
     public function where($where)
143 158
     {
144 159
         return $this->add('where', $where);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Escaper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Query/ResultSet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Query/MultiResultSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Connection/PdoConnection.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@
 block discarded – undo
18 18
         $this->dsn = $dsn;
19 19
     }
20 20
 
21
+    /**
22
+     * @param string $query
23
+     */
21 24
     public function query($query)
22 25
     {
23 26
         $this->initialize();
Please login to merge, or discard this patch.
IndexManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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`')
Please login to merge, or discard this patch.