Passed
Push — master ( 0418ea...9259d3 )
by Fran
03:33
created
src/base/types/Api.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
          *
172 172
          * @param ModelCriteria $query
173 173
          */
174
-        private function addOrders(ModelCriteria &$query)
174
+        private function addOrders(ModelCriteria & $query)
175 175
         {
176 176
             $orderAdded = FALSE;
177 177
             foreach ($this->order->getOrders() as $field => $direction) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                     $orderAdded = TRUE;
180 180
                     if ($direction === Order::ASC) {
181 181
                         $query->addAscendingOrderByColumn($field);
182
-                    } else {
182
+                    }else {
183 183
                         $query->addDescendingOrderByColumn($field);
184 184
                     }
185 185
                 }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
          *
195 195
          * @param ModelCriteria $query
196 196
          */
197
-        private function addExtraColumns(ModelCriteria &$query)
197
+        private function addExtraColumns(ModelCriteria & $query)
198 198
         {
199 199
             if (!empty($this->extraColumns)) {
200 200
                 foreach ($this->extraColumns as $expression => $columnName) {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
          *
209 209
          * @param ModelCriteria $query
210 210
          */
211
-        protected function joinTables(ModelCriteria &$query)
211
+        protected function joinTables(ModelCriteria & $query)
212 212
         {
213 213
             //TODO for specific implementations
214 214
         }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
          *
219 219
          * @param ModelCriteria $query
220 220
          */
221
-        private function addFilters(ModelCriteria &$query)
221
+        private function addFilters(ModelCriteria & $query)
222 222
         {
223 223
             if (count($this->query) > 0) {
224 224
                 foreach ($this->query as $field => $value) {
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                             $text = preg_replace('/(\'|\")/', '', $value);
237 237
                             $text = preg_replace('/\ /', '%', $text);
238 238
                             $query->filterBy($tableField, '%'.$text.'%', Criteria::LIKE);
239
-                        } else {
239
+                        }else {
240 240
                             $query->filterBy($tableField, $value, Criteria::EQUAL);
241 241
                         }
242 242
                     }
@@ -259,10 +259,10 @@  discard block
 block discarded – undo
259 259
                 list($page, $limit) = $this->extractPagination();
260 260
                 if ($limit == -1) {
261 261
                     $this->list = $query->find($this->con);
262
-                } else {
262
+                }else {
263 263
                     $this->list = $query->paginate($page, $limit, $this->con);
264 264
                 }
265
-            } catch (\Exception $e) {
265
+            }catch (\Exception $e) {
266 266
                 Logger::log($e->getMessage(), LOG_ERR);
267 267
             }
268 268
         }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                 $this->joinTables($query);
280 280
                 $this->addExtraColumns($query);
281 281
                 $this->model = $query->findPk($pk);
282
-            } catch (\Exception $e) {
282
+            }catch (\Exception $e) {
283 283
                 Logger::getInstance(get_class($this))->errorLog($e->getMessage());
284 284
             }
285 285
         }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     $saved = TRUE;
368 368
                     $model = $this->model->toArray();
369 369
                 }
370
-            } catch (\Exception $e) {
370
+            }catch (\Exception $e) {
371 371
                 Logger::log($e->getMessage(), LOG_ERR);
372 372
             }
373 373
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                         $this->model->delete($this->con);
396 396
                         $deleted = TRUE;
397 397
                     }
398
-                } catch (\Exception $e) {
398
+                }catch (\Exception $e) {
399 399
                     Logger::getInstance(get_class($this->model))->errorLog($e->getMessage());
400 400
                 }
401 401
             }
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
          */
440 440
         private function extractQuery()
441 441
         {
442
-            $queryReflector = new \ReflectionClass($this->getModelNamespace() . "Query");
442
+            $queryReflector = new \ReflectionClass($this->getModelNamespace()."Query");
443 443
             /** @var \Propel\Runtime\ActiveQuery\ModelCriteria $query */
444 444
             $query = $queryReflector->getMethod('create')->invoke($this->con);
445 445
 
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
             if (null !== $this->con && $this->con->inTransaction()) {
484 484
                 if ($status === 200) {
485 485
                     $this->con->commit();
486
-                } else {
486
+                }else {
487 487
                     $this->con->rollBack();
488 488
                 }
489 489
             }
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
             return $this->render('api.admin.html.twig', array(
528 528
                 "api"    => $this->getApi(),
529 529
                 "domain" => $this->domain,
530
-                "url"    => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower('api-' . $this->getApi() . "-pk"), TRUE)),
530
+                "url"    => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower('api-'.$this->getApi()."-pk"), TRUE)),
531 531
             ), [], '');
532 532
         }
533 533
 
@@ -561,12 +561,12 @@  discard block
 block discarded – undo
561 561
             $pages = 0;
562 562
             try {
563 563
                 $this->paginate();
564
-                if(null !== $this->list) {
564
+                if (null !== $this->list) {
565 565
                     $return = $this->list->toArray();
566 566
                     $total = $this->list->getNbResults();
567 567
                     $pages = $this->list->getLastPage();
568 568
                 }
569
-            } catch (\Exception $e) {
569
+            }catch (\Exception $e) {
570 570
                 Logger::getInstance(get_class($this))->errorLog($e->getMessage());
571 571
             }
572 572
 
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
             $return = array();
586 586
             if (NULL === $model && method_exists($model, 'toArray')) {
587 587
                 $code = 404;
588
-            } else {
588
+            }else {
589 589
                 $return = $model->toArray();
590 590
             }
591 591
 
Please login to merge, or discard this patch.
src/base/types/Controller.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
     public function render($template, array $vars = array(), $cookies = array(), $domain = null)
36 36
     {
37 37
         $vars['__menu__'] = $this->getMenu();
38
-        $domain = (null ===$domain) ? $this->getDomain() : $domain;
39
-        $this->tpl->render($domain . $template, $vars, $cookies);
38
+        $domain = (null === $domain) ? $this->getDomain() : $domain;
39
+        $this->tpl->render($domain.$template, $vars, $cookies);
40 40
     }
41 41
 
42 42
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     {
68 68
         $vars['__menu__'] = $this->getMenu();
69 69
         $domain = $domain ?: $this->getDomain();
70
-        return $this->tpl->dump($domain . $template, $vars);
70
+        return $this->tpl->dump($domain.$template, $vars);
71 71
     }
72 72
 
73 73
     /**
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
         /////////////////////////////////////////////////////////////
97 97
         // Date in the past sets the value to already have been expired.
98 98
         header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
99
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
99
+        header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
100 100
         header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
101 101
         header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
102 102
         header("Pragma: no-cache");
103 103
         header("Expires: 0");
104 104
         header('Content-Transfer-Encoding: none');
105
-        header("Content-type: " . $content);
106
-        header("Content-length: " . strlen($data));
107
-        header('Content-Disposition: attachment; filename="' . $filename . '"');
105
+        header("Content-type: ".$content);
106
+        header("Content-length: ".strlen($data));
107
+        header('Content-Disposition: attachment; filename="'.$filename.'"');
108 108
         echo $data;
109 109
         ob_flush();
110 110
         ob_end_clean();
Please login to merge, or discard this patch.
src/base/types/helpers/ApiHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
                 $fDto = self::generateNumericField($field);
36 36
             } elseif ($mappedColumn->isText()) {
37 37
                 $fDto = self::generateStringField($field);
38
-            } elseif($mappedColumn->getType() === PropelTypes::BOOLEAN) {
38
+            } elseif ($mappedColumn->getType() === PropelTypes::BOOLEAN) {
39 39
                 $fDto = self::generateBooleanField($field);
40 40
             }
41 41
 
42
-            if(null !== $fDto) {
42
+            if (null !== $fDto) {
43 43
                 $form->addField($fDto);
44 44
             }
45 45
         }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $fDto->required = $mappedColumn->isNotNull();
60 60
         $relatedModel = strtolower($mappedColumn->getRelation()->getForeignTable()->getPhpName());
61 61
         $fDto->entity = $relatedModel;
62
-        $fDto->url = Router::getInstance()->getRoute('api-' . $relatedModel . '-pk');
62
+        $fDto->url = Router::getInstance()->getRoute('api-'.$relatedModel.'-pk');
63 63
         return $fDto;
64 64
     }
65 65
 
Please login to merge, or discard this patch.