Completed
Push — master ( c5f7e7...d580f1 )
by Fran
03:37
created
src/base/types/Api.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
          *
175 175
          * @param ModelCriteria $query
176 176
          */
177
-        private function addOrders(ModelCriteria &$query)
177
+        private function addOrders(ModelCriteria & $query)
178 178
         {
179 179
             $orderAdded = FALSE;
180 180
             foreach ($this->order->getOrders() as $field => $direction) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     $orderAdded = TRUE;
183 183
                     if ($direction === Order::ASC) {
184 184
                         $query->addAscendingOrderByColumn($field);
185
-                    } else {
185
+                    }else {
186 186
                         $query->addDescendingOrderByColumn($field);
187 187
                     }
188 188
                 }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
          *
198 198
          * @param ModelCriteria $query
199 199
          */
200
-        private function addFilters(ModelCriteria &$query)
200
+        private function addFilters(ModelCriteria & $query)
201 201
         {
202 202
             if (count($this->query) > 0) {
203 203
                 foreach ($this->query as $field => $value) {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                         } elseif (preg_match('/^(\'|\")(.*)(\'|\")$/', $value)) {
215 215
                             $text = preg_replace('/(\'|\")/', '', $value);
216 216
                             $query->filterBy($tableField, $text, Criteria::LIKE);
217
-                        } else {
217
+                        }else {
218 218
                             $query->filterBy($tableField, $value, Criteria::EQUAL);
219 219
                         }
220 220
                     }
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
                 list($page, $limit) = $this->extractPagination();
236 236
                 if ($limit == -1) {
237 237
                     $this->list = $query->find($this->con);
238
-                } else {
238
+                }else {
239 239
                     $this->list = $query->paginate($page, $limit, $this->con);
240 240
                 }
241
-            } catch (\Exception $e) {
241
+            }catch (\Exception $e) {
242 242
                 Logger::getInstance(get_class($this))->errorLog($e->getMessage());
243 243
             }
244 244
         }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             try {
254 254
                 $query = $this->extractQuery();
255 255
                 $this->model = $query->findPk($pk);
256
-            } catch (\Exception $e) {
256
+            }catch (\Exception $e) {
257 257
                 Logger::getInstance(get_class($this))->errorLog($e->getMessage());
258 258
             }
259 259
         }
@@ -281,14 +281,14 @@  discard block
 block discarded – undo
281 281
                     $return = $this->list->toArray();
282 282
                     $total = $this->list->getNbResults();
283 283
                     $pages = $this->list->getLastPage();
284
-                } catch (\Exception $e) {
284
+                }catch (\Exception $e) {
285 285
                     Logger::getInstance(get_class($this))->errorLog($e->getMessage());
286 286
                 }
287
-            } else {
287
+            }else {
288 288
                 $return = $this->_get($pk);
289 289
                 if (NULL === $return) {
290 290
                     $code = 404;
291
-                } else {
291
+                }else {
292 292
                     $return = $return->toArray();
293 293
                 }
294 294
             }
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
                     $saved = TRUE;
340 340
                     $model = $this->model->toArray();
341 341
                 }
342
-            } catch (\Exception $e) {
342
+            }catch (\Exception $e) {
343 343
                 Logger::getInstance()->errorLog($e->getMessage());
344 344
             }
345 345
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                         $this->model->delete($this->con);
368 368
                         $deleted = TRUE;
369 369
                     }
370
-                } catch (\Exception $e) {
370
+                }catch (\Exception $e) {
371 371
                     Logger::getInstance(get_class($this->model))->errorLog($e->getMessage());
372 372
                 }
373 373
             }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
          */
411 411
         private function extractQuery()
412 412
         {
413
-            $queryReflector = new \ReflectionClass($this->getModelNamespace() . "Query");
413
+            $queryReflector = new \ReflectionClass($this->getModelNamespace()."Query");
414 414
             /** @var \Propel\Runtime\ActiveQuery\ModelCriteria $query */
415 415
             $query = $queryReflector->getMethod('create')->invoke(NULL);
416 416
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
             if ($this->con->inTransaction()) {
455 455
                 if ($status === 200) {
456 456
                     $this->con->commit();
457
-                } else {
457
+                }else {
458 458
                     $this->con->rollBack();
459 459
                 }
460 460
             }
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             return $this->render('api.admin.html.twig', array(
498 498
                 "api"    => $this->getApi(),
499 499
                 "domain" => $this->domain,
500
-                "url"    => preg_replace('/\/$/', '', $this->getRoute(strtolower('api-' . $this->getApi() . "-pk"), TRUE)),
500
+                "url"    => preg_replace('/\/$/', '', $this->getRoute(strtolower('api-'.$this->getApi()."-pk"), TRUE)),
501 501
             ));
502 502
         }
503 503
 
Please login to merge, or discard this patch.