Passed
Push — master ( 5379a4...a2888f )
by Joao Gilberto
04:49
created
src/Repository/DBDataset.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -140,12 +140,12 @@  discard block
 block discarded – undo
140 140
 
141 141
         // Define the query key
142 142
         if (is_array($arKey2) && count($arKey2) > 0) {
143
-            $key2 = ":" . md5(json_encode($arKey2));
143
+            $key2 = ":".md5(json_encode($arKey2));
144 144
         } else {
145 145
             $key2 = "";
146 146
         }
147 147
 
148
-        return  "qry:" . $key1 . $key2;
148
+        return  "qry:".$key1.$key2;
149 149
     }
150 150
 
151 151
     public function getScalar($sql, $array = null)
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     public function getDbFunctions()
229 229
     {
230 230
         if (is_null($this->_dbFunction)) {
231
-            $dbFunc = "\\ByJG\\AnyDataset\\Database\\DB" . ucfirst($this->_connectionManagement->getDriver()) . "Functions";
231
+            $dbFunc = "\\ByJG\\AnyDataset\\Database\\DB".ucfirst($this->_connectionManagement->getDriver())."Functions";
232 232
             $this->_dbFunction = new $dbFunc();
233 233
         }
234 234
 
Please login to merge, or discard this patch.
src/Database/DBSqliteFunctions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     function limit($sql, $start, $qty)
24 24
     {
25 25
         if (strpos($sql, ' LIMIT ') === false) {
26
-            return $sql . " LIMIT $start, $qty ";
26
+            return $sql." LIMIT $start, $qty ";
27 27
         }
28 28
 
29 29
         return $sql;
Please login to merge, or discard this patch.
src/Database/SQLHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
                 if ($sql != "") {
57 57
                     $sql .= ", ";
58 58
                 }
59
-                $sql .= " " . $this->_fieldDeliLeft . $fieldname . $this->_fieldDeliRight . " = " . $this->getValue($fieldname,
60
-                        $fieldvalue, $param, $decimalpoint) . " ";
59
+                $sql .= " ".$this->_fieldDeliLeft.$fieldname.$this->_fieldDeliRight." = ".$this->getValue($fieldname,
60
+                        $fieldvalue, $param, $decimalpoint)." ";
61 61
             }
62 62
             $sql = "update $table set $sql where $filter ";
63 63
         } elseif ($type == SQLType::SQL_INSERT) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                     $campos .= ", ";
69 69
                     $valores .= ", ";
70 70
                 }
71
-                $campos .= $this->_fieldDeliLeft . $fieldname . $this->_fieldDeliRight;
71
+                $campos .= $this->_fieldDeliLeft.$fieldname.$this->_fieldDeliRight;
72 72
                 $valores .= $this->getValue($fieldname, $fieldvalue, $param, $decimalpoint);
73 73
             }
74 74
             $sql = "insert into $table ($campos) values ($valores)";
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function getValue($name, $valores, &$param, $decimalpoint)
94 94
     {
95
-        $paramName = "[[" . $name . "]]";
95
+        $paramName = "[[".$name."]]";
96 96
         if (!is_array($valores)) {
97 97
             $valores = array(SQLFieldType::TEXT, $valores);
98 98
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         if (strlen($sql) > 4) {
141 141
             $sql .= ' and ';
142 142
         }
143
-        $sql = " $fieldName " . $relation . " " . $this->getValue($fieldName, $value, $param, '.');
143
+        $sql = " $fieldName ".$relation." ".$this->getValue($fieldName, $value, $param, '.');
144 144
     }
145 145
 
146 146
     public function setFieldDelimeters($left, $right)
Please login to merge, or discard this patch.
src/Database/DBDblibFunctions.php 1 patch
Switch Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -72,50 +72,50 @@
 block discarded – undo
72 72
             if ($s) $s .= '+';
73 73
             $ch = $fmt[$i];
74 74
             switch ($ch) {
75
-                case 'Y':
76
-                case 'y':
77
-                    $s .= "datename(yyyy,$col)";
78
-                    break;
79
-                case 'M':
80
-                    $s .= "convert(char(3),$col,0)";
81
-                    break;
82
-                case 'm':
83
-                    $s .= "replace(str(month($col),2),' ','0')";
84
-                    break;
85
-                case 'Q':
86
-                case 'q':
87
-                    $s .= "datename(quarter,$col)";
88
-                    break;
89
-                case 'D':
90
-                case 'd':
91
-                    $s .= "replace(str(day($col),2),' ','0')";
92
-                    break;
93
-                case 'h':
94
-                    $s .= "substring(convert(char(14),$col,0),13,2)";
95
-                    break;
96
-
97
-                case 'H':
98
-                    $s .= "replace(str(datepart(hh,$col),2),' ','0')";
99
-                    break;
100
-
101
-                case 'i':
102
-                    $s .= "replace(str(datepart(mi,$col),2),' ','0')";
103
-                    break;
104
-                case 's':
105
-                    $s .= "replace(str(datepart(ss,$col),2),' ','0')";
106
-                    break;
107
-                case 'a':
108
-                case 'A':
109
-                    $s .= "substring(convert(char(19),$col,0),18,2)";
110
-                    break;
111
-
112
-                default:
113
-                    if ($ch == '\\') {
114
-                        $i++;
115
-                        $ch = substr($fmt, $i, 1);
116
-                    }
117
-                    $s .= $ch;
118
-                    break;
75
+            case 'Y':
76
+            case 'y':
77
+                $s .= "datename(yyyy,$col)";
78
+                break;
79
+            case 'M':
80
+                $s .= "convert(char(3),$col,0)";
81
+                break;
82
+            case 'm':
83
+                $s .= "replace(str(month($col),2),' ','0')";
84
+                break;
85
+            case 'Q':
86
+            case 'q':
87
+                $s .= "datename(quarter,$col)";
88
+                break;
89
+            case 'D':
90
+            case 'd':
91
+                $s .= "replace(str(day($col),2),' ','0')";
92
+                break;
93
+            case 'h':
94
+                $s .= "substring(convert(char(14),$col,0),13,2)";
95
+                break;
96
+
97
+            case 'H':
98
+                $s .= "replace(str(datepart(hh,$col),2),' ','0')";
99
+                break;
100
+
101
+            case 'i':
102
+                $s .= "replace(str(datepart(mi,$col),2),' ','0')";
103
+                break;
104
+            case 's':
105
+                $s .= "replace(str(datepart(ss,$col),2),' ','0')";
106
+                break;
107
+            case 'a':
108
+            case 'A':
109
+                $s .= "substring(convert(char(19),$col,0),18,2)";
110
+                break;
111
+
112
+            default:
113
+                if ($ch == '\\') {
114
+                    $i++;
115
+                    $ch = substr($fmt, $i, 1);
116
+                }
117
+                $s .= $ch;
118
+                break;
119 119
             }
120 120
         }
121 121
         return $s;
Please login to merge, or discard this patch.
src/Database/DBMysqlFunctions.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
     function concat($s1, $s2 = null)
11 11
     {
12
-        return "concat(" . implode(func_get_args(), ', ') . ")";
12
+        return "concat(".implode(func_get_args(), ', ').")";
13 13
     }
14 14
 
15 15
     /**
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     function limit($sql, $start, $qty)
23 23
     {
24 24
         if (strpos($sql, ' LIMIT ') === false) {
25
-            return $sql . " LIMIT $start, $qty ";
25
+            return $sql." LIMIT $start, $qty ";
26 26
         }
27 27
 
28 28
         return $sql;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     function sqlDate($fmt, $col = false)
68 68
     {
69 69
         if (!$col) $col = 'now()';
70
-        $s = 'DATE_FORMAT(' . $col . ",'";
70
+        $s = 'DATE_FORMAT('.$col.",'";
71 71
         $concat = false;
72 72
         $len = strlen($fmt);
73 73
         for ($i = 0; $i < $len; $i++) {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                     break;
129 129
             }
130 130
         }
131
-        $s.="')";
131
+        $s .= "')";
132 132
         if ($concat) $s = "CONCAT($s)";
133 133
         return $s;
134 134
     }
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,7 +66,9 @@  discard block
 block discarded – undo
66 66
      */
67 67
     function sqlDate($fmt, $col = false)
68 68
     {
69
-        if (!$col) $col = 'now()';
69
+        if (!$col) {
70
+            $col = 'now()';
71
+        }
70 72
         $s = 'DATE_FORMAT(' . $col . ",'";
71 73
         $concat = false;
72 74
         $len = strlen($fmt);
@@ -81,8 +83,11 @@  discard block
 block discarded – undo
81 83
                 case 'q':
82 84
                     $s .= "'),Quarter($col)";
83 85
 
84
-                    if ($len > $i + 1) $s .= ",DATE_FORMAT($col,'";
85
-                    else $s .= ",('";
86
+                    if ($len > $i + 1) {
87
+                        $s .= ",DATE_FORMAT($col,'";
88
+                    } else {
89
+                        $s .= ",('";
90
+                    }
86 91
                     $concat = true;
87 92
                     break;
88 93
                 case 'M':
@@ -129,7 +134,9 @@  discard block
 block discarded – undo
129 134
             }
130 135
         }
131 136
         $s.="')";
132
-        if ($concat) $s = "CONCAT($s)";
137
+        if ($concat) {
138
+            $s = "CONCAT($s)";
139
+        }
133 140
         return $s;
134 141
     }
135 142
 
Please login to merge, or discard this patch.
src/Database/DBPgsqlFunctions.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     function limit($sql, $start, $qty)
21 21
     {
22 22
         if (strpos($sql, ' LIMIT ') === false) {
23
-            return $sql . " LIMIT $qty OFFSET $start ";
23
+            return $sql." LIMIT $qty OFFSET $start ";
24 24
         }
25 25
 
26 26
         return $sql;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     function sqlDate($fmt, $col = false)
66 66
     {
67 67
         if (!$col) $col = 'current_timestamp';
68
-        $s = 'TO_CHAR(' . $col . ",'";
68
+        $s = 'TO_CHAR('.$col.",'";
69 69
 
70 70
         $len = strlen($fmt);
71 71
         for ($i = 0; $i < $len; $i++) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                     break;
94 94
 
95 95
                 case 'H':
96
-                    $s.= 'HH24';
96
+                    $s .= 'HH24';
97 97
                     break;
98 98
 
99 99
                 case 'h':
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
                     if (strpos('-/.:;, ', $ch) !== false) {
123 123
                         $s .= $ch;
124 124
                     } else {
125
-                        $s .= '"' . $ch . '"';
125
+                        $s .= '"'.$ch.'"';
126 126
                     }
127 127
             }
128 128
         }
129
-        return $s . "')";
129
+        return $s."')";
130 130
     }
131 131
 
132 132
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@
 block discarded – undo
64 64
      */
65 65
     function sqlDate($fmt, $col = false)
66 66
     {
67
-        if (!$col) $col = 'current_timestamp';
67
+        if (!$col) {
68
+            $col = 'current_timestamp';
69
+        }
68 70
         $s = 'TO_CHAR(' . $col . ",'";
69 71
 
70 72
         $len = strlen($fmt);
Please login to merge, or discard this patch.