Passed
Pull Request — master (#4)
by Kris
01:54
created
lib/Driver/Postgres/PostgresDriver.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function lastInsertedId()
123 123
     {
124
-       // Postgres does not set pdo->lastInsertedId
125
-       // use sequence
126
-       try {
124
+        // Postgres does not set pdo->lastInsertedId
125
+        // use sequence
126
+        try {
127 127
             $rq = $this->pdo->prepare('SELECT LASTVAL()');
128 128
             $rq->execute();
129 129
             return $rq->fetchColumn();
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
     public function addForeignKey($fkName, $srcTable, $srcColumn, $refTable, $refColumn)
169 169
     {
170 170
         $sql = sprintf('ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s)',
171
-                       $this->escape($srcTable),
172
-                       $fkName,
173
-                       $this->escape($srcColumn),
174
-                       $this->escape($refTable),
175
-                       $this->escape($refColumn)
171
+                        $this->escape($srcTable),
172
+                        $fkName,
173
+                        $this->escape($srcColumn),
174
+                        $this->escape($refTable),
175
+                        $this->escape($refColumn)
176 176
         );
177 177
         return $this->prepareAndExecuteSql($sql);
178 178
     }
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
     public function dropForeignKey($fkName, $tableName, $ifExists = false)
190 190
     {
191 191
         $sql = sprintf('ALTER TABLE %s DROP CONSTRAINT %s %s',
192
-                       $this->escape($tableName),
193
-                       $ifExists ? 'IF EXISTS' : '',
194
-                       $fkName
192
+                        $this->escape($tableName),
193
+                        $ifExists ? 'IF EXISTS' : '',
194
+                        $fkName
195 195
         );
196 196
         return $this->prepareAndExecuteSql($sql);
197 197
     }
Please login to merge, or discard this patch.
lib/Driver/Mysql/MysqlDriver.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
     public function addForeignKey($fkName, $srcTable, $srcColumn, $refTable, $refColumn)
148 148
     {
149 149
         $sql = sprintf('ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s)',
150
-                       $this->escape($srcTable),
151
-                       $fkName,
152
-                       $this->escape($srcColumn),
153
-                       $this->escape($refTable),
154
-                       $this->escape($refColumn)
150
+                        $this->escape($srcTable),
151
+                        $fkName,
152
+                        $this->escape($srcColumn),
153
+                        $this->escape($refTable),
154
+                        $this->escape($refColumn)
155 155
         );
156 156
         return $this->prepareAndExecuteSql($sql);
157 157
     }
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
     public function dropForeignKey($fkName, $tableName)
169 169
     {
170 170
         $sql = sprintf('ALTER TABLE %s DROP FOREIGN KEY %s',
171
-                       $this->escape($tableName),
172
-                       $fkName
171
+                        $this->escape($tableName),
172
+                        $fkName
173 173
         );
174 174
         return $this->prepareAndExecuteSql($sql);
175 175
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     "'" . $userPassword ."'"
224 224
         ));
225 225
         return $this->prepareAndExecuteSql($sql);
226
-   }
226
+    }
227 227
 
228 228
     /**
229 229
      * Drop a user
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      *
254 254
      * @return bool     True if the user has been granted, otherwise false. 
255 255
      */
256
-     public function grantUser($databaseName, $userName)
256
+        public function grantUser($databaseName, $userName)
257 257
     {
258 258
         $sql = trim(sprintf('GRANT ALL ON %s.* TO %s@%s; FLUSH PRIVILEGES;', 
259 259
             $this->escape($databaseName),
Please login to merge, or discard this patch.
lib/Query/Select.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 case 'sub_query':
106 106
                     $colsList[] = '('. $val['query']->sql() .') AS '. $this->escape($val['alias']);
107 107
                     break;
108
-           }
108
+            }
109 109
         }
110 110
         return $sqlDistinct . implode(', ', $colsList);
111 111
     }
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
         }
154 154
 
155 155
         return trim(implode(' ', ['SELECT', 
156
-           $this->sqlColumns(), 
157
-           $sqlFromTable,
158
-           $sqlJoins,
159
-           $sqlWhere,
160
-           $sqlGroupBy,
161
-           $sqlHaving,
162
-           $sqlOrderBy,
163
-           $sqlLimit,
164
-           $sqlOffset]));
156
+            $this->sqlColumns(), 
157
+            $sqlFromTable,
158
+            $sqlJoins,
159
+            $sqlWhere,
160
+            $sqlGroupBy,
161
+            $sqlHaving,
162
+            $sqlOrderBy,
163
+            $sqlLimit,
164
+            $sqlOffset]));
165 165
     }
166 166
      
167 167
     /**
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
     public function getAll(string $outputFormat = 'default')
176 176
     {
177 177
         // execute query
178
-       $exec = $this->execute();
178
+        $exec = $this->execute();
179 179
 
180
-       // format
181
-       $format = ($outputFormat === 'default') ? $this->driver->defaultOutputFormat() : $outputFormat; 
180
+        // format
181
+        $format = ($outputFormat === 'default') ? $this->driver->defaultOutputFormat() : $outputFormat; 
182 182
 
183 183
         // return output
184 184
         return QueryBuilder::fetchOutput($this, $exec, $format);
Please login to merge, or discard this patch.
lib/Driver/DatabaseDriver.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  */
34 34
 abstract class DatabaseDriver
35 35
 {
36
-   /**
36
+    /**
37 37
      * PDO connection
38 38
      *
39 39
      * @access protected
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
      * @var string
75 75
      */
76 76
     public function sqlCreateTableOptions()
77
-     {
77
+        {
78 78
         return '';    
79
-     } 
79
+        } 
80 80
 
81 81
     /**
82 82
      * Gets/returns the default output format 
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function escape($str)
137 137
     {
138
-       $list = explode('.', $str);
139
-       return implode('.', $this->escapeList($list));
138
+        $list = explode('.', $str);
139
+        return implode('.', $this->escapeList($list));
140 140
     }
141 141
 
142 142
     /**
Please login to merge, or discard this patch.