Passed
Push — 5.1 ( d12c7f...922161 )
by liu
07:33
created
library/think/db/builder/Mysql.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         foreach ($dataSet as $k => $data) {
65 65
             $data = $this->parseData($query, $data, $allowFields, $bind);
66 66
 
67
-            $values[] = '( ' . implode(',', array_values($data)) . ' )';
67
+            $values[] = '( '.implode(',', array_values($data)).' )';
68 68
 
69 69
             if (!isset($insertFields)) {
70 70
                 $insertFields = array_keys($data);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $value = $value->getValue();
105 105
         }
106 106
 
107
-        return $key . ' ' . $exp . ' ' . $value;
107
+        return $key.' '.$exp.' '.$value;
108 108
     }
109 109
 
110 110
     /**
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
 
126 126
         $key = trim($key);
127 127
 
128
-        if(strpos($key, '->>') && false === strpos($key, '(')){
128
+        if (strpos($key, '->>') && false === strpos($key, '(')) {
129 129
             // JSON字段支持
130 130
             list($field, $name) = explode('->>', $key, 2);
131 131
 
132
-            return $this->parseKey($query, $field, true) . '->>\'$' . (strpos($name, '[') === 0 ? '' : '.') . str_replace('->>', '.', $name) . '\'';
132
+            return $this->parseKey($query, $field, true).'->>\'$'.(strpos($name, '[') === 0 ? '' : '.').str_replace('->>', '.', $name).'\'';
133 133
         }
134 134
         elseif (strpos($key, '->') && false === strpos($key, '(')) {
135 135
             // JSON字段支持
136 136
             list($field, $name) = explode('->', $key, 2);
137 137
 
138
-            return 'json_extract(' . $this->parseKey($query, $field, true) . ', \'$' . (strpos($name, '[') === 0 ? '' : '.') . str_replace('->', '.', $name) . '\')';
138
+            return 'json_extract('.$this->parseKey($query, $field, true).', \'$'.(strpos($name, '[') === 0 ? '' : '.').str_replace('->', '.', $name).'\')';
139 139
         } elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) {
140 140
             list($table, $key) = explode('.', $key, 2);
141 141
 
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) {
155
-            throw new Exception('not support data:' . $key);
155
+            throw new Exception('not support data:'.$key);
156 156
         }
157 157
 
158 158
         if ('*' != $key && !preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {
159
-            $key = '`' . $key . '`';
159
+            $key = '`'.$key.'`';
160 160
         }
161 161
 
162 162
         if (isset($table)) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 $table = str_replace('.', '`.`', $table);
165 165
             }
166 166
 
167
-            $key = '`' . $table . '`.' . $key;
167
+            $key = '`'.$table.'`.'.$key;
168 168
         }
169 169
 
170 170
         return $key;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,8 +130,7 @@
 block discarded – undo
130 130
             list($field, $name) = explode('->>', $key, 2);
131 131
 
132 132
             return $this->parseKey($query, $field, true) . '->>\'$' . (strpos($name, '[') === 0 ? '' : '.') . str_replace('->>', '.', $name) . '\'';
133
-        }
134
-        elseif (strpos($key, '->') && false === strpos($key, '(')) {
133
+        } elseif (strpos($key, '->') && false === strpos($key, '(')) {
135 134
             // JSON字段支持
136 135
             list($field, $name) = explode('->', $key, 2);
137 136
 
Please login to merge, or discard this patch.