Completed
Push — master ( e64965...5fb12e )
by Adeniyi
04:14 queued 01:57
created
src/Database/DatabaseQuery.php 2 patches
Doc Comments   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param  $tablename
63 63
      * @param  $con
64 64
      *
65
-     * @return bool
65
+     * @return boolean|null
66 66
      */
67 67
     public function checkTableExist($table, $con=NULL)
68 68
     {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     /**
78 78
      * checkTableName Return the table name
79 79
      *
80
-     * @param  $tablename
80
+     * @param  string|false $tablename
81 81
      * @param  $con
82 82
      *
83 83
      * @return string
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * checkColumn Check if column exist in table
102 102
      *
103 103
      * @param  $tableName
104
-     * @param  $columnName
104
+     * @param  string $columnName
105 105
      * @param  $con
106 106
      *
107 107
      * @return string
@@ -194,6 +194,7 @@  discard block
 block discarded – undo
194 194
     /**
195 195
      * selectAllQuery
196 196
      *
197
+     * @param string $tableName
197 198
      * @return string
198 199
      */
199 200
     public static function selectAllQuery($tableName)
@@ -229,6 +230,8 @@  discard block
 block discarded – undo
229 230
     /**
230 231
      * selectQuery
231 232
      *
233
+     * @param string $tableName
234
+     * @param string $connection
232 235
      * @return string
233 236
      */
234 237
     public static function selectQuery($tableName, $data, $condition, $connection)
@@ -256,6 +259,7 @@  discard block
 block discarded – undo
256 259
     /**
257 260
      * insertQuery
258 261
      *
262
+     * @param string $tableName
259 263
      * @return string
260 264
      */
261 265
     public function insertQuery($tableName)
@@ -273,6 +277,7 @@  discard block
 block discarded – undo
273 277
     /**
274 278
      * updateQuery
275 279
      *
280
+     * @param string $tableName
276 281
      * @return string
277 282
      */
278 283
     public function updateQuery($tableName)
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,8 +136,9 @@  discard block
 block discarded – undo
136 136
         {
137 137
             $counter++;
138 138
             $insertQuery .= self::sanitize($key);
139
-            if( $arraySize > $counter )
140
-                $insertQuery .= ", ";
139
+            if( $arraySize > $counter ) {
140
+                            $insertQuery .= ", ";
141
+            }
141 142
         }
142 143
         return $insertQuery;
143 144
     }
@@ -159,8 +160,9 @@  discard block
 block discarded – undo
159 160
         {
160 161
             $counter++;
161 162
             $insertQuery .= "'".self::sanitize($value) ."'";
162
-            if( $arraySize > $counter )
163
-                $insertQuery .= ", ";
163
+            if( $arraySize > $counter ) {
164
+                            $insertQuery .= ", ";
165
+            }
164 166
         }
165 167
         return $insertQuery;
166 168
     }
@@ -240,8 +242,7 @@  discard block
 block discarded – undo
240 242
             if( $arraySize > 1 && $condition == NULL)
241 243
             {
242 244
                 $query = "Please Supply the condition";
243
-            }
244
-            else
245
+            } else
245 246
             {
246 247
                 $columnName = self::whereAndClause($tableName, $data, $condition);
247 248
                 $query =  "SELECT * FROM $tableName WHERE $columnName";
Please login to merge, or discard this patch.
src/Helper/Model.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,6 +51,7 @@  discard block
 block discarded – undo
51 51
     /**
52 52
      * getTableName()
53 53
      *
54
+     * @param string $connection
54 55
      * @return string
55 56
      */
56 57
     public static function getTableName($connection)
@@ -62,7 +63,7 @@  discard block
 block discarded – undo
62 63
      * getALL()
63 64
      * Get all record from the database
64 65
      *
65
-     * @return object
66
+     * @return GetData|null
66 67
      */
67 68
     public function getALL($dbConnection = NULL)
68 69
     {
@@ -90,7 +91,7 @@  discard block
 block discarded – undo
90 91
      * where($data, $condition)
91 92
      * Get data from database where $data = $condition
92 93
      *
93
-     * @return object
94
+     * @return GetData|null
94 95
      */
95 96
     public function where($data, $condition = NULL, $dbConnection = NULL)
96 97
     {
@@ -121,7 +122,7 @@  discard block
 block discarded – undo
121 122
      * find($value)
122 123
      * Find data from database where id = $value
123 124
      *
124
-     * @return array
125
+     * @return Model|null
125 126
      */
126 127
     public static function find($value, $dbConnection = NULL)
127 128
     {
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
             echo $e->errorMessage();
111 111
         } catch ( TableDoesNotExistException $e ){
112 112
             echo $e->errorMessage();
113
-        }  catch ( InvalidConnectionException $e ){
113
+        } catch ( InvalidConnectionException $e ){
114 114
             echo $e->errorMessage();
115
-        }  catch ( ColumnNotExistExeption $e ){
115
+        } catch ( ColumnNotExistExeption $e ){
116 116
             echo $e->errorMessage();
117 117
         }
118 118
     }
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
             echo $e->errorMessage();
144 144
         } catch ( TableDoesNotExistException $e ){
145 145
             echo $e->errorMessage();
146
-        }  catch ( InvalidConnectionException $e ){
146
+        } catch ( InvalidConnectionException $e ){
147 147
             echo $e->errorMessage();
148
-        }  catch ( ColumnNotExistExeption $e ){
148
+        } catch ( ColumnNotExistExeption $e ){
149 149
             echo $e->errorMessage();
150 150
         }
151 151
     }
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
             return $e->getMessage();
176 176
         } catch ( TableDoesNotExistException $e ){
177 177
             echo $e->errorMessage();
178
-        }  catch ( InvalidConnectionException $e ){
178
+        } catch ( InvalidConnectionException $e ){
179 179
             echo $e->errorMessage();
180
-        }  catch ( ColumnNotExistExeption $e ){
180
+        } catch ( ColumnNotExistExeption $e ){
181 181
             echo $e->errorMessage();
182 182
         }
183 183
     }
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
             return $e->getMessage();
208 208
         } catch ( TableDoesNotExistException $e ){
209 209
             echo $e->errorMessage();
210
-        }  catch ( InvalidConnectionException $e ){
210
+        } catch ( InvalidConnectionException $e ){
211 211
             echo $e->errorMessage();
212
-        }  catch ( ColumnNotExistExeption $e ){
212
+        } catch ( ColumnNotExistExeption $e ){
213 213
             echo $e->errorMessage();
214 214
         }
215 215
     }
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
             return $e->errorMessage();
238 238
         } catch ( TableDoesNotExistException $e ){
239 239
             echo $e->errorMessage();
240
-        }  catch ( InvalidConnectionException $e ){
240
+        } catch ( InvalidConnectionException $e ){
241 241
             echo $e->errorMessage();
242
-        }  catch ( ColumnNotExistExeption $e ){
242
+        } catch ( ColumnNotExistExeption $e ){
243 243
             echo $e->errorMessage();
244 244
         }
245 245
     }
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.