Completed
Push — master ( 672085...644962 )
by Adeniyi
12s
created
src/Database/DatabaseQuery.php 4 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.
Doc Comments   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,6 +83,7 @@  discard block
 block discarded – undo
83 83
     /**
84 84
      * getTableName()
85 85
      *
86
+     * @param string $connection
86 87
      * @return string
87 88
      */
88 89
     protected function getTableName($connection)
@@ -123,7 +124,7 @@  discard block
 block discarded – undo
123 124
      * @param  $tablename
124 125
      * @param  $con
125 126
      *
126
-     * @return bool
127
+     * @return boolean|null
127 128
      */
128 129
     public function checkTableExist($table, $con=NULL)
129 130
     {
@@ -138,7 +139,7 @@  discard block
 block discarded – undo
138 139
     /**
139 140
      * checkTableName Return the table name
140 141
      *
141
-     * @param  $tablename
142
+     * @param  string $tablename
142 143
      * @param  $con
143 144
      *
144 145
      * @return string
@@ -159,7 +160,7 @@  discard block
 block discarded – undo
159 160
      * checkColumn Check if column exist in table
160 161
      *
161 162
      * @param  $tableName
162
-     * @param  $columnName
163
+     * @param  string $columnName
163 164
      * @param  $con
164 165
      *
165 166
      * @return string
@@ -268,6 +269,7 @@  discard block
 block discarded – undo
268 269
     /**
269 270
      * selectAllQuery
270 271
      *
272
+     * @param string $tableName
271 273
      * @return string
272 274
      */
273 275
     public function selectAllQuery($tableName)
@@ -327,6 +329,9 @@  discard block
 block discarded – undo
327 329
     /**
328 330
      * selectQuery
329 331
      *
332
+     * @param string $tableName
333
+     * @param string $fields
334
+     * @param string $connection
330 335
      * @return string
331 336
      */
332 337
     public static function selectQuery($tableName, $fields, $data, $condition, $connection)
@@ -360,6 +365,7 @@  discard block
 block discarded – undo
360 365
     /**
361 366
      * insertQuery
362 367
      *
368
+     * @param string $tableName
363 369
      * @return string
364 370
      */
365 371
     public function insertQuery($tableName)
@@ -373,6 +379,7 @@  discard block
 block discarded – undo
373 379
     /**
374 380
      * updateQuery
375 381
      *
382
+     * @param string $tableName
376 383
      * @return string
377 384
      */
378 385
     public function updateQuery($tableName, $id)
@@ -387,7 +394,8 @@  discard block
 block discarded – undo
387 394
      * query($query, $dbCOnnection)
388 395
      * Raw sql query
389 396
      *
390
-     * @return object
397
+     * @param string $query
398
+     * @return GetData
391 399
      */
392 400
     public function query($query, $con = NULL)
393 401
     {
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
      *
126 126
      * @return bool
127 127
      */
128
-    public function checkTableExist($table, $con=NULL)
128
+    public function checkTableExist($table, $con = NULL)
129 129
     {
130 130
         $connection = $this->checkConnection($con);
131 131
         $query = $connection->query("SELECT 1 FROM {$table} LIMIT 1");
132
-        if($query !== false)
132
+        if ($query !== false)
133 133
         {
134 134
             return true;
135 135
         }
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @return string
145 145
      */
146
-    protected static function checkTableName($tableName, $con=NULL)
146
+    protected static function checkTableName($tableName, $con = NULL)
147 147
     {
148 148
         $connection = self::checkConnection($con);
149 149
 
150 150
         $query = $connection->query("SELECT 1 FROM {$tableName} LIMIT 1");
151
-        if($query !== false)
151
+        if ($query !== false)
152 152
         {
153 153
             return $tableName;
154 154
         }
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
      *
165 165
      * @return string
166 166
      */
167
-    protected static function checkColumn($tableName, $columnName, $con=NULL)
167
+    protected static function checkColumn($tableName, $columnName, $con = NULL)
168 168
     {
169 169
         $connection = self::checkConnection($con);
170 170
 
171 171
             $result = $connection->prepare("SELECT {$columnName} FROM {$tableName}");
172 172
             $result->execute();
173
-            if (! $result->columnCount())
173
+            if ( ! $result->columnCount())
174 174
             {
175 175
                 throw new ColumnNotExistExeption();
176 176
             }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         {
195 195
             $counter++;
196 196
             $insertQuery .= self::sanitize($key);
197
-            if($arraySize > $counter)
197
+            if ($arraySize > $counter)
198 198
                 $insertQuery .= ", ";
199 199
         }
200 200
         return $insertQuery;
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
         foreach ($data as $key => $value)
217 217
         {
218 218
             $counter++;
219
-            $insertQuery .= "'".self::sanitize($value) ."'";
220
-            if($arraySize > $counter)
219
+            $insertQuery .= "'".self::sanitize($value)."'";
220
+            if ($arraySize > $counter)
221 221
                 $insertQuery .= ", ";
222 222
         }
223 223
         return $insertQuery;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         {
241 241
             $counter++;
242 242
             $columnName = self::checkColumn($tableName, self::sanitize($key));
243
-            $updateQuery .= $columnName ." = '".self::sanitize($value)."'";
243
+            $updateQuery .= $columnName." = '".self::sanitize($value)."'";
244 244
             if ($arraySize > $counter)
245 245
             {
246 246
                 $updateQuery .= ", ";
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
             {
292 292
                 $counter++;
293 293
                 $columnName = self::checkColumn($tableName, self::sanitize($key));
294
-                $where .= $tableName.'.'.$columnName ." = '".self::sanitize($value)."'";
294
+                $where .= $tableName.'.'.$columnName." = '".self::sanitize($value)."'";
295 295
                 if ($arraySize > $counter)
296 296
                 {
297
-                    $where .= " " . $condition . " ";
297
+                    $where .= " ".$condition." ";
298 298
                 }
299 299
             }
300 300
         } else {
@@ -310,14 +310,14 @@  discard block
 block discarded – undo
310 310
         $counter = 0;
311 311
         $arraySize = count($data);
312 312
 
313
-        foreach ( $data as $key => $value )
313
+        foreach ($data as $key => $value)
314 314
         {
315 315
             $counter++;
316 316
             $columnName = self::checkColumn($tableName, self::sanitize($key));
317
-            $where .= $columnName ." LIKE '%".self::sanitize($value)."%'";
318
-            if ( $arraySize > $counter )
317
+            $where .= $columnName." LIKE '%".self::sanitize($value)."%'";
318
+            if ($arraySize > $counter)
319 319
             {
320
-                $where .= " " . $condition . " ";
320
+                $where .= " ".$condition." ";
321 321
             }
322 322
         }
323 323
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         try
338 338
         {
339 339
             $arraySize = count($data);
340
-            if( $arraySize > 1 && $condition == NULL)
340
+            if ($arraySize > 1 && $condition == NULL)
341 341
             {
342 342
                 $query = "Please Supply the condition";
343 343
             }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                 } elseif ($condition === 'LIKE') {
349 349
                     $columnName = self::whereLikeClause($tableName, $data, $condition);
350 350
                 } 
351
-                $query =  "SELECT $fields FROM $tableName WHERE $columnName";
351
+                $query = "SELECT $fields FROM $tableName WHERE $columnName";
352 352
             }
353 353
         } catch (PDOException $e) {
354 354
             $query = $e->getMessage();
Please login to merge, or discard this patch.
src/Database/DBConfig.php 2 patches
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.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             {
48 48
                 parent::__construct($this->mysqlConnectionString(), $this->user, $this->password);
49 49
             }
50
-            elseif($this->driver === 'sqlite')
50
+            elseif ($this->driver === 'sqlite')
51 51
             {
52 52
                 parent::__construct($this->sqlitConnectionString());
53 53
             }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected function pgsqlConnectionString()
65 65
     {
66
-        return $this->driver . ':host=' . $this->host . ';port=' . $this->port . ';dbname=' . $this->dbname . ';user=' . $this->user . ';password=' . $this->password;
66
+        return $this->driver.':host='.$this->host.';port='.$this->port.';dbname='.$this->dbname.';user='.$this->user.';password='.$this->password;
67 67
     }
68 68
 
69 69
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     protected function mysqlConnectionString()
75 75
     {
76
-        return $this->driver . ':host=' . $this->host . ';dbname=' . $this->dbname . ';charset=utf8mb4';
76
+        return $this->driver.':host='.$this->host.';dbname='.$this->dbname.';charset=utf8mb4';
77 77
     }
78 78
 
79 79
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function sqlitConnectionString()
85 85
     {
86
-        return $this->driver . ':' . $this->sqlitePath;
86
+        return $this->driver.':'.$this->sqlitePath;
87 87
     }
88 88
 
89 89
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     protected function loadEnv()
93 93
     {
94
-        if( ! getenv("APP_ENV"))
94
+        if ( ! getenv("APP_ENV"))
95 95
         {
96 96
             $dotenv = new Dotenv($_SERVER['DOCUMENT_ROOT']);
97 97
             $dotenv->load();
Please login to merge, or discard this patch.
src/Helper/Inflector.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 trait Inflector
40 40
 {
41 41
     /**
42
-    * Pluralizes English nouns.
43
-    *
44
-    * @access public
45
-    * @static
46
-    * @param    string    $word    English noun to pluralize
47
-    * @return string Plural noun
48
-    */
42
+     * Pluralizes English nouns.
43
+     *
44
+     * @access public
45
+     * @static
46
+     * @param    string    $word    English noun to pluralize
47
+     * @return string Plural noun
48
+     */
49 49
     public static function pluralize($word)
50 50
     {
51 51
         $plural = array(
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
     }
103 103
 
104 104
     /**
105
-    * Singularizes English nouns.
106
-    *
107
-    * @access public
108
-    * @static
109
-    * @param    string    $word    English noun to singularize
110
-    * @return string Singular noun.
111
-    */
105
+     * Singularizes English nouns.
106
+     *
107
+     * @access public
108
+     * @static
109
+     * @param    string    $word    English noun to singularize
110
+     * @return string Singular noun.
111
+     */
112 112
     public function singularize($word)
113 113
     {
114 114
         $singular = array (
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
 
82 82
         $lowercased_word = strtolower($word);
83 83
 
84
-        foreach ($uncountable as $_uncountable){
85
-            if(substr($lowercased_word,(-1*strlen($_uncountable))) == $_uncountable){
84
+        foreach ($uncountable as $_uncountable) {
85
+            if (substr($lowercased_word, (-1*strlen($_uncountable))) == $_uncountable) {
86 86
                 return $word;
87 87
             }
88 88
         }
89 89
 
90
-        foreach ($irregular as $_plural=> $_singular){
90
+        foreach ($irregular as $_plural=> $_singular) {
91 91
             if (preg_match('/('.$_plural.')$/i', $word, $arr)) {
92
-                return preg_replace('/('.$_plural.')$/i', substr($arr[0],0,1).substr($_singular,1), $word);
92
+                return preg_replace('/('.$_plural.')$/i', substr($arr[0], 0, 1).substr($_singular, 1), $word);
93 93
             }
94 94
         }
95 95
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     */
112 112
     public function singularize($word)
113 113
     {
114
-        $singular = array (
114
+        $singular = array(
115 115
             '/(quiz)zes$/i'             => "$1",
116 116
             '/(matr)ices$/i'            => "$1ix",
117 117
             '/(vert|ind)ices$/i'        => "$1ex",
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
         'move' => 'moves');
153 153
 
154 154
         $lowercased_word = strtolower($word);
155
-        foreach ($uncountable as $_uncountable){
156
-            if(substr($lowercased_word,(-1*strlen($_uncountable))) == $_uncountable){
155
+        foreach ($uncountable as $_uncountable) {
156
+            if (substr($lowercased_word, (-1*strlen($_uncountable))) == $_uncountable) {
157 157
                 return $word;
158 158
             }
159 159
         }
160 160
 
161
-        foreach ($irregular as $_plural=> $_singular){
161
+        foreach ($irregular as $_plural=> $_singular) {
162 162
             if (preg_match('/('.$_singular.')$/i', $word, $arr)) {
163
-                return preg_replace('/('.$_singular.')$/i', substr($arr[0],0,1).substr($_plural,1), $word);
163
+                return preg_replace('/('.$_singular.')$/i', substr($arr[0], 0, 1).substr($_plural, 1), $word);
164 164
             }
165 165
         }
166 166
 
Please login to merge, or discard this patch.
src/Helper/Schema.php 3 patches
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.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return array
27 27
      */
28
-    public function field($type, $fieldName, $length=NULL)
28
+    public function field($type, $fieldName, $length = NULL)
29 29
     {
30
-        if($length === null){
31
-             $this->fieldDescription[] = $type ." ".$fieldName;
32
-        }else
30
+        if ($length === null) {
31
+             $this->fieldDescription[] = $type." ".$fieldName;
32
+        } else
33 33
         {
34
-         $this->fieldDescription[] = $type ." ".$fieldName." ".$length;
34
+         $this->fieldDescription[] = $type." ".$fieldName." ".$length;
35 35
         }
36 36
 
37 37
     }
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
             $fields = explode(" ", $fieldName);
52 52
          
53 53
             $constrain = $fields[0];
54
-            if(count($fields) == 2)
54
+            if (count($fields) == 2)
55 55
             {
56
-                $query .= $this->$constrain($fields[1], 20) .", ".PHP_EOL;
57
-            }else
56
+                $query .= $this->$constrain($fields[1], 20).", ".PHP_EOL;
57
+            } else
58 58
             {
59
-                    $query .= $this->$constrain($fields[1], $fields[2]) .", ".PHP_EOL;
59
+                    $query .= $this->$constrain($fields[1], $fields[2]).", ".PHP_EOL;
60 60
             }
61 61
         };
62 62
         array_walk($this->fieldDescription, $callback);
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
         {
91 91
             $sqlQuery = self::sanitizeQuery($tablename);
92 92
             $query = $connection->prepare($sqlQuery);
93
-            if($query->execute())
93
+            if ($query->execute())
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
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function strings($value, $length)
118 118
     {
119
-        return $value ." varchar (".$length.") NOT NULL";
119
+        return $value." varchar (".$length.") NOT NULL";
120 120
     }
121 121
 
122 122
     /**
@@ -202,6 +202,6 @@  discard block
 block discarded – undo
202 202
                     $apend = 'timestamp';
203 203
                 break;
204 204
         }
205
-        return $value . " " . $apend . " NOT NULL";
205
+        return $value." ".$apend." NOT NULL";
206 206
     }
207 207
 }
208 208
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
     public function field($type, $fieldName, $length=NULL)
29 29
     {
30 30
         if($length === null){
31
-             $this->fieldDescription[] = $type ." ".$fieldName;
31
+                $this->fieldDescription[] = $type ." ".$fieldName;
32 32
         }else
33 33
         {
34
-         $this->fieldDescription[] = $type ." ".$fieldName." ".$length;
34
+            $this->fieldDescription[] = $type ." ".$fieldName." ".$length;
35 35
         }
36 36
 
37 37
     }
Please login to merge, or discard this patch.
src/Exceptions/EmptyDatabaseException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function errorMessage()
27 27
     {
28
-        return "Error: " . $this->getMessage();
28
+        return "Error: ".$this->getMessage();
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/ErrorInsertingException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function errorMessage()
27 27
     {
28
-        return "Error: " . $this->getMessage();
28
+        return "Error: ".$this->getMessage();
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
src/Helper/Model.php 3 patches
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.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * getALL()
26 26
      * Get all record from the database
27 27
      *
28
-     * @return object
28
+     * @return GetData
29 29
      */
30 30
     public function getAll($dbConnection = NULL)
31 31
     {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * where($data, $condition)
45 45
      * Get data from database where $data = $condition
46 46
      *
47
-     * @return object
47
+     * @return GetData
48 48
      */
49 49
     public function where($data, $condition = NULL, $dbConnection = NULL)
50 50
     {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * find($value)
65 65
      * Find data from database where id = $value
66 66
      *
67
-     * @return array
67
+     * @return Model
68 68
      */
69 69
     public static function find($value, $dbConnection = NULL)
70 70
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         $query = $this->insertQuery(self::getTableName($connection));
96 96
         $statement = $connection->prepare($query);
97
-        if($statement->execute()) {
97
+        if ($statement->execute()) {
98 98
             return true;
99 99
         }
100 100
         throw new  DataAlreadyExistException();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $connection = DatabaseQuery::checkConnection($dbConnection);
131 131
 
132
-        $query = $connection->prepare('DELETE FROM ' . self::getTableName($connection) . ' WHERE id = '.$value);
132
+        $query = $connection->prepare('DELETE FROM '.self::getTableName($connection).' WHERE id = '.$value);
133 133
         $query->execute();
134 134
         $check = $query->rowCount();
135 135
         if ($check) {
Please login to merge, or discard this patch.
src/Exceptions/DataAlreadyExistException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function errorMessage()
27 27
     {
28
-        return "Error: " . $this->getMessage();
28
+        return "Error: ".$this->getMessage();
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
src/Exceptions/DataNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function errorMessage()
27 27
     {
28
-        return "Error: " . $this->getMessage();
28
+        return "Error: ".$this->getMessage();
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.