Completed
Pull Request — master (#27)
by Adeniyi
02:29
created
src/Database/DatabaseQuery.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use PDOException;
14 14
 use Ibonly\PotatoORM\DatabaseQueryInterface;
15 15
 use Ibonly\PotatoORM\ColumnNotExistExeption;
16
-use Ibonly\PotatoORM\InvalidConnectionException;
17 16
 use Ibonly\PotatoORM\TableDoesNotExistException;
18 17
 
19 18
 class DatabaseQuery implements DatabaseQueryInterface
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -216,8 +216,9 @@  discard block
 block discarded – undo
216 216
         {
217 217
             $counter++;
218 218
             $insertQuery .= self::sanitize($key);
219
-            if($arraySize > $counter)
220
-                $insertQuery .= ", ";
219
+            if($arraySize > $counter) {
220
+                            $insertQuery .= ", ";
221
+            }
221 222
         }
222 223
 
223 224
         return $insertQuery;
@@ -241,8 +242,9 @@  discard block
 block discarded – undo
241 242
         {
242 243
             $counter++;
243 244
             $insertQuery .= "'".self::sanitize($value) ."'";
244
-            if($arraySize > $counter)
245
-                $insertQuery .= ", ";
245
+            if($arraySize > $counter) {
246
+                            $insertQuery .= ", ";
247
+            }
246 248
         }
247 249
         return $insertQuery;
248 250
     }
@@ -326,8 +328,7 @@  discard block
 block discarded – undo
326 328
             if($arraySize > 1 && $condition == NULL)
327 329
             {
328 330
                 $query = "Please Supply the condition";
329
-            }
330
-            else
331
+            } else
331 332
             {
332 333
                 $columnName = self::whereAndClause($tableName, $data, $condition);
333 334
                 $query =  "SELECT $fields FROM $tableName WHERE $columnName";
Please login to merge, or discard this patch.
src/Database/DBConfig.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,12 +42,10 @@
 block discarded – undo
42 42
             if ($this->driver === 'pgsql' || $this->driver === 'postgres')
43 43
             {
44 44
                 parent::__construct($this->pgsqlConnectionString());
45
-            }
46
-            elseif ($this->driver === 'mysql')
45
+            } elseif ($this->driver === 'mysql')
47 46
             {
48 47
                 parent::__construct($this->mysqlConnectionString(), $this->user, $this->password);
49
-            }
50
-            elseif($this->driver === 'sqlite')
48
+            } elseif($this->driver === 'sqlite')
51 49
             {
52 50
                 parent::__construct($this->sqlitConnectionString());
53 51
             }
Please login to merge, or discard this patch.
src/Helper/Schema.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         if(is_null($length)){
31 31
              $this->fieldDescription[] = $type ." ".$fieldName;
32
-        }else
32
+        } else
33 33
         {
34 34
          $this->fieldDescription[] = $type ." ".$fieldName." ".$length;
35 35
         }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             if(sizeof($e) == 2)
53 53
             {
54 54
                 $query .= $this->$e[0]($e[1], 20) .", ".PHP_EOL;
55
-            }else
55
+            } else
56 56
             {
57 57
                     $query .= $this->$e[0]($e[1], $e[2]) .", ".PHP_EOL;
58 58
             }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             {
95 95
                 return true;
96 96
             }
97
-        }catch(PDOException $e){
97
+        } catch(PDOException $e){
98 98
             return $e->getMessage();
99 99
         }
100 100
     }
Please login to merge, or discard this patch.
src/Helper/Model.php 1 patch
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -9,17 +9,12 @@
 block discarded – undo
9 9
 
10 10
 namespace Ibonly\PotatoORM;
11 11
 
12
-use PDO;
13
-use Exception;
14
-use PDOException;
15 12
 use Ibonly\PotatoORM\GetData;
16 13
 use Ibonly\PotatoORM\DatabaseQuery;
17 14
 use Ibonly\PotatoORM\ModelInterface;
18 15
 use Ibonly\PotatoORM\UserNotFoundException;
19 16
 use Ibonly\PotatoORM\EmptyDatabaseException;
20 17
 use Ibonly\PotatoORM\SaveUserExistException;
21
-use Ibonly\PotatoORM\ColumnNotExistExeption;
22
-use Ibonly\PotatoORM\InvalidConnectionException;
23 18
 
24 19
 class Model extends DatabaseQuery implements ModelInterface
25 20
 {
Please login to merge, or discard this patch.