Completed
Push — master ( a52629...cbc88e )
by Joao
04:07
created
src/Database/DBPDODriver.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,9 @@
 block discarded – undo
92 92
             foreach ($array as $key => $value) {
93 93
                 $stmt->bindValue(":" . SQLBind::keyAdj($key), $value);
94 94
             }
95
-        } else $stmt = $this->_db->prepare($sql);
95
+        } else {
96
+            $stmt = $this->_db->prepare($sql);
97
+        }
96 98
 
97 99
         return $stmt;
98 100
     }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 
27 27
         if (is_null($strcnn)) {
28 28
             if ($this->_connectionManagement->getFilePath() != "") {
29
-                $strcnn = $this->_connectionManagement->getDriver() . ":" . $this->_connectionManagement->getFilePath();
29
+                $strcnn = $this->_connectionManagement->getDriver().":".$this->_connectionManagement->getFilePath();
30 30
             } else {
31
-                $strcnn = $this->_connectionManagement->getDriver() . ":dbname=" . $this->_connectionManagement->getDatabase();
31
+                $strcnn = $this->_connectionManagement->getDriver().":dbname=".$this->_connectionManagement->getDatabase();
32 32
                 if ($this->_connectionManagement->getExtraParam("unixsocket") != "") {
33
-                    $strcnn .= ";unix_socket=" . $this->_connectionManagement->getExtraParam("unixsocket");
33
+                    $strcnn .= ";unix_socket=".$this->_connectionManagement->getExtraParam("unixsocket");
34 34
                 } else {
35
-                    $strcnn .= ";host=" . $this->_connectionManagement->getServer();
35
+                    $strcnn .= ";host=".$this->_connectionManagement->getServer();
36 36
                     if ($this->_connectionManagement->getPort() != "") {
37
-                        $strcnn .= ";port=" . $this->_connectionManagement->getPort();
37
+                        $strcnn .= ";port=".$this->_connectionManagement->getPort();
38 38
                     }
39 39
                 }
40 40
             }
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 
43 43
         // Create Connection
44 44
         $this->_db = new PDO($strcnn, $this->_connectionManagement->getUsername(),
45
-            $this->_connectionManagement->getPassword(), (array) $preOptions);
45
+            $this->_connectionManagement->getPassword(), (array)$preOptions);
46 46
         $this->_connectionManagement->setDriver($this->_db->getAttribute(PDO::ATTR_DRIVER_NAME));
47 47
 
48 48
         // Set Specific Attributes
49 49
         $this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
50 50
         $this->_db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
51 51
 
52
-        foreach ((array) $postOptions as $key => $value) {
52
+        foreach ((array)$postOptions as $key => $value) {
53 53
             $this->_db->setAttribute($key, $value);
54 54
         }
55 55
     }
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
             throw new \ByJG\AnyDataset\Exception\NotAvailableException("Extension 'PDO' is not loaded");
61 61
         }
62 62
 
63
-        if (!extension_loaded('pdo_' . strtolower($connMngt->getDriver()))) {
64
-            throw new \ByJG\AnyDataset\Exception\NotAvailableException("Extension 'pdo_" . strtolower($connMngt->getDriver()) . "' is not loaded");
63
+        if (!extension_loaded('pdo_'.strtolower($connMngt->getDriver()))) {
64
+            throw new \ByJG\AnyDataset\Exception\NotAvailableException("Extension 'pdo_".strtolower($connMngt->getDriver())."' is not loaded");
65 65
         }
66 66
 
67
-        $class = '\ByJG\AnyDataset\Database\Pdo' . ucfirst($connMngt->getDriver());
67
+        $class = '\ByJG\AnyDataset\Database\Pdo'.ucfirst($connMngt->getDriver());
68 68
 
69 69
         if (!class_exists($class, true)) {
70 70
             return new DBPDODriver($connMngt, null, null, null);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             list($sql, $array) = SQLBind::parseSQL($this->_connectionManagement, $sql, $array);
91 91
             $stmt = $this->_db->prepare($sql);
92 92
             foreach ($array as $key => $value) {
93
-                $stmt->bindValue(":" . SQLBind::keyAdj($key), $value);
93
+                $stmt->bindValue(":".SQLBind::keyAdj($key), $value);
94 94
             }
95 95
         } else $stmt = $this->_db->prepare($sql);
96 96
 
Please login to merge, or discard this patch.
src/Database/DBSQLRelayDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             sqlrcur_prepareQuery($cur, $sql);
57 57
             $bindCount = 1;
58 58
             foreach ($array as $key => $value) {
59
-                $field = strval($bindCount ++);
59
+                $field = strval($bindCount++);
60 60
                 sqlrcur_inputBind($cur, $field, $value);
61 61
             }
62 62
             $success = sqlrcur_executeQuery($cur);
Please login to merge, or discard this patch.
src/Database/DBDblibFunctions.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,12 +68,16 @@
 block discarded – undo
68 68
      */
69 69
     function sqlDate($fmt, $col = false)
70 70
     {
71
-        if (!$col) $col = "getdate()";
71
+        if (!$col) {
72
+            $col = "getdate()";
73
+        }
72 74
         $s = '';
73 75
 
74 76
         $len = strlen($fmt);
75 77
         for ($i = 0; $i < $len; $i++) {
76
-            if ($s) $s .= '+';
78
+            if ($s) {
79
+                $s .= '+';
80
+            }
77 81
             $ch = $fmt[$i];
78 82
             switch ($ch) {
79 83
                 case 'Y':
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     {
13 13
         for ($i = 0, $numArgs = func_num_args(); $i < $numArgs; $i++) {
14 14
             $var = func_get_arg($i);
15
-            $sql .= ($i == 0 ? "" : "+") . $var;
15
+            $sql .= ($i == 0 ? "" : "+").$var;
16 16
         }
17 17
 
18 18
         return $sql;
Please login to merge, or discard this patch.
src/Database/DBPgsqlFunctions.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@
 block discarded – undo
69 69
      */
70 70
     function sqlDate($fmt, $col = false)
71 71
     {
72
-        if (!$col) $col = $this->sysTimeStamp;
72
+        if (!$col) {
73
+            $col = $this->sysTimeStamp;
74
+        }
73 75
         $s = 'TO_CHAR(' . $col . ",'";
74 76
 
75 77
         $len = strlen($fmt);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     {
10 10
         for ($i = 0, $numArgs = func_num_args(); $i < $numArgs; $i++) {
11 11
             $var = func_get_arg($i);
12
-            $sql .= ($i == 0 ? "" : " || ") . $var;
12
+            $sql .= ($i == 0 ? "" : " || ").$var;
13 13
         }
14 14
 
15 15
         return $sql;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     function sqlDate($fmt, $col = false)
71 71
     {
72 72
         if (!$col) $col = $this->sysTimeStamp;
73
-        $s = 'TO_CHAR(' . $col . ",'";
73
+        $s = 'TO_CHAR('.$col.",'";
74 74
 
75 75
         $len = strlen($fmt);
76 76
         for ($i = 0; $i < $len; $i++) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                     break;
99 99
 
100 100
                 case 'H':
101
-                    $s.= 'HH24';
101
+                    $s .= 'HH24';
102 102
                     break;
103 103
 
104 104
                 case 'h':
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
                     if (strpos('-/.:;, ', $ch) !== false) {
128 128
                         $s .= $ch;
129 129
                     } else {
130
-                        $s .= '"' . $ch . '"';
130
+                        $s .= '"'.$ch.'"';
131 131
                     }
132 132
             }
133 133
         }
134
-        return $s . "')";
134
+        return $s."')";
135 135
     }
136 136
 
137 137
     /**
Please login to merge, or discard this patch.
src/Database/DBMysqlFunctions.php 2 patches
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,9 @@  discard block
 block discarded – undo
75 75
      */
76 76
     function sqlDate($fmt, $col = false)
77 77
     {
78
-        if (!$col) $col = $this->sysTimeStamp;
78
+        if (!$col) {
79
+            $col = $this->sysTimeStamp;
80
+        }
79 81
         $s = 'DATE_FORMAT(' . $col . ",'";
80 82
         $concat = false;
81 83
         $len = strlen($fmt);
@@ -90,8 +92,11 @@  discard block
 block discarded – undo
90 92
                 case 'q':
91 93
                     $s .= "'),Quarter($col)";
92 94
 
93
-                    if ($len > $i + 1) $s .= ",DATE_FORMAT($col,'";
94
-                    else $s .= ",('";
95
+                    if ($len > $i + 1) {
96
+                        $s .= ",DATE_FORMAT($col,'";
97
+                    } else {
98
+                        $s .= ",('";
99
+                    }
95 100
                     $concat = true;
96 101
                     break;
97 102
                 case 'M':
@@ -138,7 +143,9 @@  discard block
 block discarded – undo
138 143
             }
139 144
         }
140 145
         $s.="')";
141
-        if ($concat) $s = "CONCAT($s)";
146
+        if ($concat) {
147
+            $s = "CONCAT($s)";
148
+        }
142 149
         return $s;
143 150
     }
144 151
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
         $sql = "concat(";
15 15
         for ($i = 0, $numArgs = func_num_args(); $i < $numArgs; $i++) {
16 16
             $var = func_get_arg($i);
17
-            $sql .= ($i == 0 ? "" : ",") . $var;
17
+            $sql .= ($i == 0 ? "" : ",").$var;
18 18
         }
19 19
         $sql .= ")";
20 20
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     function sqlDate($fmt, $col = false)
77 77
     {
78 78
         if (!$col) $col = $this->sysTimeStamp;
79
-        $s = 'DATE_FORMAT(' . $col . ",'";
79
+        $s = 'DATE_FORMAT('.$col.",'";
80 80
         $concat = false;
81 81
         $len = strlen($fmt);
82 82
         for ($i = 0; $i < $len; $i++) {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     break;
138 138
             }
139 139
         }
140
-        $s.="')";
140
+        $s .= "')";
141 141
         if ($concat) $s = "CONCAT($s)";
142 142
         return $s;
143 143
     }
Please login to merge, or discard this patch.
src/Repository/JsonIterator.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@  discard block
 block discarded – undo
27 27
         }
28 28
 
29 29
         if ($path != "") {
30
-            if ($path[0] == "/") $path = substr($path, 1);
30
+            if ($path[0] == "/") {
31
+                $path = substr($path, 1);
32
+            }
31 33
 
32 34
             $pathAr = explode("/", $path);
33 35
 
@@ -44,7 +46,9 @@  discard block
 block discarded – undo
44 46
                 }
45 47
             }
46 48
             $this->_jsonObject = $newjsonObject;
47
-        } else $this->_jsonObject = $jsonObject;
49
+        } else {
50
+            $this->_jsonObject = $jsonObject;
51
+        }
48 52
 
49 53
         $this->_current = 0;
50 54
     }
Please login to merge, or discard this patch.
src/Repository/ArrayDataset.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
26 26
 
27 27
         $this->_array = array();
28 28
 
29
-        if (!$array) return;
29
+        if (!$array) {
30
+            return;
31
+        }
30 32
 
31 33
         if (is_array($array)) {
32 34
             foreach ($array as $key => $value) {
Please login to merge, or discard this patch.
src/Repository/IteratorFilter.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,9 @@
 block discarded – undo
264 264
 
265 265
             $field = $array->getField($name);
266 266
 
267
-            if (!is_array($field)) $field = array($field);
267
+            if (!is_array($field)) {
268
+                $field = array($field);
269
+            }
268 270
 
269 271
             foreach ($field as $valueparam) {
270 272
                 switch ($relation) {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         if ($xpathFilter == "") {
38 38
             return "/anydataset/row";
39 39
         } else {
40
-            return "/anydataset/row[" . $xpathFilter . "]";
40
+            return "/anydataset/row[".$xpathFilter."]";
41 41
         }
42 42
     }
43 43
 
@@ -136,33 +136,33 @@  discard block
 block discarded – undo
136 136
     private function getStrXpathRelation($name, $relation, $value)
137 137
     {
138 138
         $str = is_numeric($value) ? "" : "'";
139
-        $field = "field[@name='" . $name . "'] ";
139
+        $field = "field[@name='".$name."'] ";
140 140
         $value = " $str$value$str ";
141 141
 
142 142
         $result = "";
143 143
         switch ($relation) {
144 144
             case Relation::EQUAL: {
145
-                    $result = $field . "=" . $value;
145
+                    $result = $field."=".$value;
146 146
                     break;
147 147
                 }
148 148
             case Relation::GREATER_THAN: {
149
-                    $result = $field . ">" . $value;
149
+                    $result = $field.">".$value;
150 150
                     break;
151 151
                 }
152 152
             case Relation::LESS_THAN: {
153
-                    $result = $field . "<" . $value;
153
+                    $result = $field."<".$value;
154 154
                     break;
155 155
                 }
156 156
             case Relation::GREATER_OR_EQUAL_THAN: {
157
-                    $result = $field . ">=" . $value;
157
+                    $result = $field.">=".$value;
158 158
                     break;
159 159
                 }
160 160
             case Relation::LESS_OR_EQUAL_THAN: {
161
-                    $result = $field . "<=" . $value;
161
+                    $result = $field."<=".$value;
162 162
                     break;
163 163
                 }
164 164
             case Relation::NOT_EQUAL: {
165
-                    $result = $field . "!=" . $value;
165
+                    $result = $field."!=".$value;
166 166
                     break;
167 167
                 }
168 168
             case Relation::STARTS_WITH: {
@@ -191,47 +191,47 @@  discard block
 block discarded – undo
191 191
         $paramName = $name;
192 192
         $i = 0;
193 193
         while (array_key_exists($paramName, $param)) {
194
-            $paramName = $name . ($i++);
194
+            $paramName = $name.($i++);
195 195
         }
196 196
 
197 197
         $param[$paramName] = $value;
198 198
 
199 199
         $result = "";
200 200
         $field = " $name ";
201
-        $valueparam = " [[" . $paramName . "]] ";
201
+        $valueparam = " [[".$paramName."]] ";
202 202
         switch ($relation) {
203 203
             case Relation::EQUAL: {
204
-                    $result = $field . "=" . $valueparam;
204
+                    $result = $field."=".$valueparam;
205 205
                     break;
206 206
                 }
207 207
             case Relation::GREATER_THAN: {
208
-                    $result = $field . ">" . $valueparam;
208
+                    $result = $field.">".$valueparam;
209 209
                     break;
210 210
                 }
211 211
             case Relation::LESS_THAN: {
212
-                    $result = $field . "<" . $valueparam;
212
+                    $result = $field."<".$valueparam;
213 213
                     break;
214 214
                 }
215 215
             case Relation::GREATER_OR_EQUAL_THAN: {
216
-                    $result = $field . ">=" . $valueparam;
216
+                    $result = $field.">=".$valueparam;
217 217
                     break;
218 218
                 }
219 219
             case Relation::LESS_OR_EQUAL_THAN: {
220
-                    $result = $field . "<=" . $valueparam;
220
+                    $result = $field."<=".$valueparam;
221 221
                     break;
222 222
                 }
223 223
             case Relation::NOT_EQUAL: {
224
-                    $result = $field . "!=" . $valueparam;
224
+                    $result = $field."!=".$valueparam;
225 225
                     break;
226 226
                 }
227 227
             case Relation::STARTS_WITH: {
228
-                    $param[$paramName] = $value . "%";
229
-                    $result = $field . " like " . $valueparam;
228
+                    $param[$paramName] = $value."%";
229
+                    $result = $field." like ".$valueparam;
230 230
                     break;
231 231
                 }
232 232
             case Relation::CONTAINS: {
233
-                    $param[$paramName] = "%" . $value . "%";
234
-                    $result = $field . " like " . $valueparam;
233
+                    $param[$paramName] = "%".$value."%";
234
+                    $result = $field." like ".$valueparam;
235 235
                     break;
236 236
                 }
237 237
         }
Please login to merge, or discard this patch.
src/Repository/AnyDataset.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -310,7 +310,9 @@
 block discarded – undo
310 310
 
311 311
     protected function quickSortExec($seq, $field)
312 312
     {
313
-        if (!count($seq)) return $seq;
313
+        if (!count($seq)) {
314
+            return $seq;
315
+        }
314 316
 
315 317
         $k = $seq [0];
316 318
         $x = $y = array();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                     if (!is_null($attr)) {
105 105
                         $sr->addField($attr->nodeValue, $field->nodeValue);
106 106
                     } else {
107
-                        throw new \InvalidArgumentException('Malformed anydataset file ' . basename($filepath));
107
+                        throw new \InvalidArgumentException('Malformed anydataset file '.basename($filepath));
108 108
                     }
109 109
                 }
110 110
                 $sr->acceptChanges();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $x = $y = array();
317 317
 
318 318
         $cntSeq = count($seq);
319
-        for ($i = 1; $i < $cntSeq; $i ++) {
319
+        for ($i = 1; $i < $cntSeq; $i++) {
320 320
             if ($seq[$i]->getField($field) <= $k->getField($field)) {
321 321
                 $x [] = $seq [$i];
322 322
             } else {
Please login to merge, or discard this patch.