Completed
Pull Request — master (#1)
by Joao
04:01 queued 01:28
created
src/Database/SqlHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                     $campos .= ", ";
80 80
                     $valores .= ", ";
81 81
                 }
82
-                $campos .= $this->fieldDeliLeft . $fieldname . $this->fieldDeliRight;
82
+                $campos .= $this->fieldDeliLeft.$fieldname.$this->fieldDeliRight;
83 83
                 $valores .= $this->getValue($fieldname, $fieldvalue, $param, $decimalpoint);
84 84
             }
85 85
             $sql = "insert into $table ($campos) values ($valores)";
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     protected function getValue($name, $valores, &$param, $decimalpoint)
105 105
     {
106
-        $paramName = "[[" . $name . "]]";
106
+        $paramName = "[[".$name."]]";
107 107
         if (!is_array($valores)) {
108 108
             $valores = array(SQLFieldType::TEXT, $valores);
109 109
         }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         if (strlen($sql) > 4) {
152 152
             $sql .= ' and ';
153 153
         }
154
-        $sql = " $fieldName " . $relation . " " . $this->getValue($fieldName, $value, $param, '.');
154
+        $sql = " $fieldName ".$relation." ".$this->getValue($fieldName, $value, $param, '.');
155 155
     }
156 156
 
157 157
     public function setFieldDelimeters($left, $right)
Please login to merge, or discard this patch.
src/Database/DbPdoDriver.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 
28 28
         if (is_null($strcnn)) {
29 29
             if ($this->connectionManagement->getFilePath() != "") {
30
-                $strcnn = $this->connectionManagement->getDriver() . ":" . $this->connectionManagement->getFilePath();
30
+                $strcnn = $this->connectionManagement->getDriver().":".$this->connectionManagement->getFilePath();
31 31
             } else {
32
-                $strcnn = $this->connectionManagement->getDriver() . ":dbname=" .
32
+                $strcnn = $this->connectionManagement->getDriver().":dbname=".
33 33
                     $this->connectionManagement->getDatabase();
34 34
                 if ($this->connectionManagement->getExtraParam("unixsocket") != "") {
35
-                    $strcnn .= ";unix_socket=" . $this->connectionManagement->getExtraParam("unixsocket");
35
+                    $strcnn .= ";unix_socket=".$this->connectionManagement->getExtraParam("unixsocket");
36 36
                 } else {
37
-                    $strcnn .= ";host=" . $this->connectionManagement->getServer();
37
+                    $strcnn .= ";host=".$this->connectionManagement->getServer();
38 38
                     if ($this->connectionManagement->getPort() != "") {
39
-                        $strcnn .= ";port=" . $this->connectionManagement->getPort();
39
+                        $strcnn .= ";port=".$this->connectionManagement->getPort();
40 40
                     }
41 41
                 }
42 42
             }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             $strcnn,
48 48
             $this->connectionManagement->getUsername(),
49 49
             $this->connectionManagement->getPassword(),
50
-            (array) $preOptions
50
+            (array)$preOptions
51 51
         );
52 52
         $this->connectionManagement->setDriver($this->instance->getAttribute(PDO::ATTR_DRIVER_NAME));
53 53
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $this->instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
56 56
         $this->instance->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
57 57
 
58
-        foreach ((array) $postOptions as $key => $value) {
58
+        foreach ((array)$postOptions as $key => $value) {
59 59
             $this->instance->setAttribute($key, $value);
60 60
         }
61 61
     }
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
             throw new NotAvailableException("Extension 'PDO' is not loaded");
67 67
         }
68 68
 
69
-        if (!extension_loaded('pdo_' . strtolower($connMngt->getDriver()))) {
70
-            throw new NotAvailableException("Extension 'pdo_" . strtolower($connMngt->getDriver()) . "' is not loaded");
69
+        if (!extension_loaded('pdo_'.strtolower($connMngt->getDriver()))) {
70
+            throw new NotAvailableException("Extension 'pdo_".strtolower($connMngt->getDriver())."' is not loaded");
71 71
         }
72 72
 
73
-        $class = '\ByJG\AnyDataset\Database\Pdo' . ucfirst($connMngt->getDriver());
73
+        $class = '\ByJG\AnyDataset\Database\Pdo'.ucfirst($connMngt->getDriver());
74 74
 
75 75
         if (!class_exists($class, true)) {
76 76
             return new DbPdoDriver($connMngt, null, null, null);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             list($sql, $array) = SqlBind::parseSQL($this->connectionManagement, $sql, $array);
97 97
             $stmt = $this->instance->prepare($sql);
98 98
             foreach ($array as $key => $value) {
99
-                $stmt->bindValue(":" . SqlBind::keyAdj($key), $value);
99
+                $stmt->bindValue(":".SqlBind::keyAdj($key), $value);
100 100
             }
101 101
         } else {
102 102
             $stmt = $this->instance->prepare($sql);
Please login to merge, or discard this patch.
src/Database/BaseDBAccess.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
         $start = 0;
59 59
         if ($debug) {
60 60
             $log = LogHandler::getInstance();
61
-            $log->debug("Class name: " . get_class($this));
62
-            $log->debug("SQL: " . $sql);
61
+            $log->debug("Class name: ".get_class($this));
62
+            $log->debug("SQL: ".$sql);
63 63
             if (!is_null($param)) {
64 64
                 $strForLog = "";
65 65
                 foreach ($param as $key => $value) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         if ($debug) {
84 84
             $end = microtime(true);
85
-            $log->debug("Execution time: " . ($end - $start) . " seconds ");
85
+            $log->debug("Execution time: ".($end - $start)." seconds ");
86 86
         }
87 87
 
88 88
         return $insertedId;
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
         $start = 0;
104 104
         if ($debug) {
105 105
             $log = LogHandler::getInstance();
106
-            $log->debug("Class name: " . get_class($this));
107
-            $log->debug("SQL: " . $sql);
106
+            $log->debug("Class name: ".get_class($this));
107
+            $log->debug("SQL: ".$sql);
108 108
             if (!is_null($param)) {
109 109
                 $strForLog = "";
110 110
                 foreach ($param as $key => $value) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $iterator = $this->getDBDataset()->getIterator($sql, $param, $ttl);
121 121
         if ($debug) {
122 122
             $end = microtime(true);
123
-            $log->debug("Execution Time: " . ($end - $start) . " segundos ");
123
+            $log->debug("Execution Time: ".($end - $start)." segundos ");
124 124
         }
125 125
         return $iterator;
126 126
     }
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
         $start = 0;
133 133
         if ($debug) {
134 134
             $log = LogHandler::getInstance();
135
-            $log->debug("Class name: " . get_class($this));
136
-            $log->debug("SQL: " . $sql);
135
+            $log->debug("Class name: ".get_class($this));
136
+            $log->debug("SQL: ".$sql);
137 137
             if (!is_null($param)) {
138 138
                 $strForLog = "";
139 139
                 foreach ($param as $key => $value) {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $scalar = $this->getDBDataset()->getScalar($sql, $param);
150 150
         if ($debug) {
151 151
             $end = microtime(true);
152
-            $log->debug("Execution Time: " . ($end - $start) . " segundos ");
152
+            $log->debug("Execution Time: ".($end - $start)." segundos ");
153 153
         }
154 154
         return $scalar;
155 155
     }
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
                     $fields = $singleRow->getFieldNames();
234 234
                 }
235 235
 
236
-                $line .= '"' . implode('","', $fields) . '"' . "\n";
236
+                $line .= '"'.implode('","', $fields).'"'."\n";
237 237
             }
238 238
 
239 239
             $raw = array();
240 240
             foreach ($fields as $field) {
241 241
                 $raw[] = $singleRow->getField($field);
242 242
             }
243
-            $line .= '"' . implode('","', array_values($raw)) . '"' . "\n";
243
+            $line .= '"'.implode('","', array_values($raw)).'"'."\n";
244 244
 
245 245
             if ($echoToBrowser) {
246 246
                 echo $line;
Please login to merge, or discard this patch.
src/Database/SqlBind.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             $arg = str_replace("_", SqlBind::keyAdj($key), $paramSubstName);
50 50
 
51 51
             $count = 0;
52
-            $sql = preg_replace("/(\[\[$key\]\]|:" . $key . "[\s\W]|:$key\$)/", $arg . ' ', $sql, -1, $count);
52
+            $sql = preg_replace("/(\[\[$key\]\]|:".$key."[\s\W]|:$key\$)/", $arg.' ', $sql, -1, $count);
53 53
             if ($count === 0) {
54 54
                 unset($params[$key]);
55 55
             }
Please login to merge, or discard this patch.
src/Database/Expressions/DbBaseFunctions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
             if (isset($pattern[$value])) {
88 88
                 $formatted = $pattern[$value];
89 89
             } else {
90
-                $formatted = $delimitString . $value . $delimitString;
90
+                $formatted = $delimitString.$value.$delimitString;
91 91
             }
92 92
             $prepareString[$key] = $formatted;
93 93
         }
Please login to merge, or discard this patch.
src/Database/Expressions/DbDblibFunctions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
         return preg_replace(
42 42
             '~(\s[Tt][Oo][Pp])\s.*?\d+\s~',
43
-            '$1 ' . $qty . ' ',
43
+            '$1 '.$qty.' ',
44 44
             $sql
45 45
         );
46 46
     }
Please login to merge, or discard this patch.
src/Database/Expressions/DbPgsqlFunctions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
26 26
         }
27 27
 
28 28
         if (stripos($sql, ' LIMIT ') === false) {
29
-            $sql = $sql . " LIMIT x OFFSET y";
29
+            $sql = $sql." LIMIT x OFFSET y";
30 30
         }
31 31
 
32 32
         return preg_replace(
33 33
             '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?\s([Oo][Ff][Ff][Ss][Ee][Tt])\s.*~',
34
-            '$1 ' . $qty .' $2 ' .$start,
34
+            '$1 '.$qty.' $2 '.$start,
35 35
             $sql
36 36
         );
37 37
     }
Please login to merge, or discard this patch.
src/Database/Expressions/DbMysqlFunctions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
     public function concat($str1, $str2 = null)
11 11
     {
12
-        return "concat(" . implode(func_get_args(), ', ') . ")";
12
+        return "concat(".implode(func_get_args(), ', ').")";
13 13
     }
14 14
 
15 15
     /**
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
         }
27 27
 
28 28
         if (stripos($sql, ' LIMIT ') === false) {
29
-            $sql = $sql . " LIMIT x, y";
29
+            $sql = $sql." LIMIT x, y";
30 30
         }
31 31
 
32 32
         return preg_replace(
33 33
             '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?,\s*.*~',
34
-            '$1 ' . $start .', ' .$qty,
34
+            '$1 '.$start.', '.$qty,
35 35
             $sql
36 36
         );
37 37
     }
Please login to merge, or discard this patch.
src/Database/Expressions/DbSqliteFunctions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
         }
33 33
 
34 34
         if (stripos($sql, ' LIMIT ') === false) {
35
-            $sql = $sql . " LIMIT x, y";
35
+            $sql = $sql." LIMIT x, y";
36 36
         }
37 37
 
38 38
         return preg_replace(
39 39
             '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?,\s*.*~',
40
-            '$1 ' . $start .', ' .$qty,
40
+            '$1 '.$start.', '.$qty,
41 41
             $sql
42 42
         );
43 43
     }
Please login to merge, or discard this patch.