Completed
Push — master ( c8a39f...4d6955 )
by Christopher
43:34 queued 28:41
created
src/Potato.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@
 block discarded – undo
193 193
     /**
194 194
      * Find a record by id and change static id param
195 195
      * @param  int $id id of the record to be found
196
-     * @return ClassInstance     an instance of the TableClass so that properties can be assigned automatically
196
+     * @return Potato     an instance of the TableClass so that properties can be assigned automatically
197 197
      */
198 198
     public static function find($id)
199 199
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         if (!$this->tableName)
28 28
         {
29 29
             $ref = new ReflectionClass($this);
30
-            $tableName = strtolower($ref->getShortName()).'s';
30
+            $tableName = strtolower($ref->getShortName()) . 's';
31 31
         }
32 32
 
33 33
         // Test if table exists else throw an exception
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         if (!empty($res)) {
125 125
             return $res;
126 126
         } else {
127
-            throw new PotatoException('There is no user with id '. $id);
127
+            throw new PotatoException('There is no user with id ' . $id);
128 128
         }
129 129
     }
130 130
 
@@ -164,21 +164,21 @@  discard block
 block discarded – undo
164 164
 
165 165
         if (!self::$id) {
166 166
             // new record so we insert
167
-            $query = "INSERT INTO $this->tableName (".implode(", ", $availableColumnNames).") VALUES('".implode("', '", $availableColumnValues)."');";
167
+            $query = "INSERT INTO $this->tableName (" . implode(", ", $availableColumnNames) . ") VALUES('" . implode("', '", $availableColumnValues) . "');";
168 168
         } else {
169 169
             // existing record, se we update
170 170
             $query = "UPDATE $this->tableName SET ";
171 171
 
172 172
             for ($i = 0; $i < count($availableColumnNames); $i++) {
173 173
                 $prop = $availableColumnNames[$i];
174
-                $query .= " $prop = '". $this->{$prop}."'";
174
+                $query .= " $prop = '" . $this->{$prop} . "'";
175 175
 
176 176
                 if ($i != count($availableColumnNames) - 1) {
177 177
                     $query .= ",";
178 178
                 }
179 179
             }
180 180
 
181
-            $query .= " WHERE id = ".self::$id;
181
+            $query .= " WHERE id = " . self::$id;
182 182
         }
183 183
 
184 184
         $result = Connection::db()->query($query);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         self::getOne($id);
215 215
 
216
-        $query = "DELETE FROM $table WHERE id = ".$id;
216
+        $query = "DELETE FROM $table WHERE id = " . $id;
217 217
 
218 218
         $result = Connection::db()->query($query);
219 219
     }
Please login to merge, or discard this patch.