Passed
Push — master ( f25758...21e806 )
by Fran
11:16
created
src/functions.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,9 +31,10 @@
 block discarded – undo
31 31
     function getallheaders()
32 32
     {
33 33
         $headers = array();
34
-        foreach ($_SERVER as $h => $v)
35
-            if (preg_match('/HTTP_(.+)/', $h, $hp))
34
+        foreach ($_SERVER as $h => $v) {
35
+                    if (preg_match('/HTTP_(.+)/', $h, $hp))
36 36
                 $headers[$hp[1]] = $v;
37
+        }
37 38
         return $headers;
38 39
     }
39 40
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,14 +48,14 @@
 block discarded – undo
48 48
     /* @var $file SplFileInfo */
49 49
     foreach ($finder as $file) {
50 50
         $path = $file->getRealPath();
51
-        if(!in_array($path, $loaded_files)) {
51
+        if (!in_array($path, $loaded_files)) {
52 52
             $loaded_files[] = $path;
53 53
             require_once($path);
54 54
         }
55 55
     }
56 56
 }
57 57
 
58
-if(!function_exists('t')) {
58
+if (!function_exists('t')) {
59 59
     function t($message, $key = null, $reload = false) {
60 60
         return CustomTranslateExtension::_($message, $key, $reload);
61 61
     }
Please login to merge, or discard this patch.
src/base/types/traits/BoostrapTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,4 +7,4 @@
 block discarded – undo
7 7
  */
8 8
 Trait BoostrapTrait {}
9 9
 
10
-require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'bootstrap.php';
11 10
\ No newline at end of file
11
+require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'bootstrap.php';
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
src/base/types/traits/OutputTrait.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
 
203 203
     /**
204 204
      * Método que fuerza la descarga de un fichero
205
-     * @param $data
205
+     * @param string $data
206 206
      * @param string $content
207 207
      * @param string $filename
208 208
      * @return mixed
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 $this->setStatusCode(Template::STATUS_OK);
121 121
                 break;
122 122
             default:
123
-                $this->setStatusCode('HTTP/1.0 ' . $status ?: 200);
123
+                $this->setStatusCode('HTTP/1.0 '.$status ?: 200);
124 124
                 break;
125 125
         }
126 126
         return $this;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         ResponseHelper::setStatusHeader($this->getStatusCode());
139 139
         ResponseHelper::setAuthHeaders($this->isPublicZone());
140 140
         ResponseHelper::setCookieHeaders($cookies);
141
-        header('Content-type: ' . $contentType);
141
+        header('Content-type: '.$contentType);
142 142
 
143 143
     }
144 144
 
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
         Logger::log('Start output response');
155 155
         ob_start();
156 156
         $this->setReponseHeaders($contentType, $cookies);
157
-        header('Content-length: ' . strlen($output));
158
-        header('CRC: ' . crc32($output));
157
+        header('Content-length: '.strlen($output));
158
+        header('CRC: '.crc32($output));
159 159
 
160 160
         $needCache = Cache::needCache();
161 161
         $cache = Cache::getInstance();
162 162
         list($path, $cacheDataName) = $cache->getRequestCacheHash();
163 163
         if (false !== $needCache && $this->getStatusCode() === Template::STATUS_OK && null !== $cacheDataName) {
164 164
             Logger::log('Saving output response into cache');
165
-            $cache->storeData("json" . DIRECTORY_SEPARATOR . $path . $cacheDataName, $output);
166
-            $cache->storeData("json" . DIRECTORY_SEPARATOR . $path . $cacheDataName . ".headers", headers_list(), Cache::JSON);
165
+            $cache->storeData("json".DIRECTORY_SEPARATOR.$path.$cacheDataName, $output);
166
+            $cache->storeData("json".DIRECTORY_SEPARATOR.$path.$cacheDataName.".headers", headers_list(), Cache::JSON);
167 167
         } elseif (Request::getInstance()->getMethod() !== 'GET') {
168 168
             $cache->flushCache();
169 169
         }
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
         Logger::log('Close template render');
184 184
         $uri = Request::requestUri();
185 185
         Security::getInstance()->setSessionKey("lastRequest", array(
186
-            "url" => Request::getInstance()->getRootUrl() . $uri,
186
+            "url" => Request::getInstance()->getRootUrl().$uri,
187 187
             "ts" => microtime(true),
188 188
         ));
189 189
         Security::getInstance()->updateSession();
190
-        Logger::log('End request: ' . $uri, LOG_INFO);
190
+        Logger::log('End request: '.$uri, LOG_INFO);
191 191
         exit;
192 192
     }
193 193
 
@@ -225,17 +225,17 @@  discard block
 block discarded – undo
225 225
         /////////////////////////////////////////////////////////////
226 226
         // Date in the past sets the value to already have been expired.
227 227
         header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
228
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
228
+        header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
229 229
         header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
230 230
         header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
231 231
         header("Pragma: no-cache");
232 232
         header("Expires: 0");
233 233
         header('Content-Transfer-Encoding: binary');
234
-        header("Content-type: " . $content);
235
-        header("Content-length: " . strlen($data));
236
-        header('Content-Disposition: attachment; filename="' . $filename . '"');
234
+        header("Content-type: ".$content);
235
+        header("Content-length: ".strlen($data));
236
+        header('Content-Disposition: attachment; filename="'.$filename.'"');
237 237
         header("Access-Control-Expose-Headers: Filename");
238
-        header("Filename: " . $filename);
238
+        header("Filename: ".$filename);
239 239
         echo $data;
240 240
         ob_flush();
241 241
         ob_end_clean();
Please login to merge, or discard this patch.
src/controller/DocumentorController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $download = $this->getRequest()->get('download') ?: false;
34 34
 
35 35
         $module = $this->srv->getModules($domain);
36
-        if(empty($module)) {
36
+        if (empty($module)) {
37 37
             return Router::getInstance()->httpNotFound(null, true);
38 38
         }
39 39
         switch (strtolower($type)) {
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
         ini_restore('max_execution_time');
54 54
         ini_restore('memory_limit');
55 55
 
56
-        if($download && $type === ApiController::SWAGGER_DOC) {
56
+        if ($download && $type === ApiController::SWAGGER_DOC) {
57 57
             return $this->download(\GuzzleHttp\json_encode($doc), 'application/json', 'swagger.json');
58
-        } elseif($type === ApiController::HTML_DOC) {
58
+        } elseif ($type === ApiController::HTML_DOC) {
59 59
             return $this->render('documentation.html.twig', ["data" => json_encode($doc)]);
60
-        } else {
60
+        }else {
61 61
             return $this->json($doc, 200);
62 62
         }
63 63
     }
Please login to merge, or discard this patch.
src/base/types/helpers/ApiHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@
 block discarded – undo
160 160
     }
161 161
 
162 162
     /**
163
-     * @param $field
163
+     * @param string $field
164 164
      * @param bool $required
165 165
      * @return Field
166 166
      */
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
         $behaviors = $tableMap->getBehaviors();
37 37
         foreach ($map::getFieldNames() as $field) {
38 38
             $fDto = self::parseFormField($domain, $tableMap, $field, $behaviors);
39
-            if(null !== $fDto) {
39
+            if (null !== $fDto) {
40 40
                 $form->addField($fDto);
41 41
             }
42 42
         }
43 43
 
44
-        if(array_key_exists('i18n', $behaviors)) {
45
-            $relateI18n = $tableMap->getRelation($tableMap->getPhpName() . 'I18n');
46
-            if(null !== $relateI18n) {
44
+        if (array_key_exists('i18n', $behaviors)) {
45
+            $relateI18n = $tableMap->getRelation($tableMap->getPhpName().'I18n');
46
+            if (null !== $relateI18n) {
47 47
                 $i18NTableMap = $relateI18n->getLocalTable();
48
-                foreach($i18NTableMap->getColumns() as $columnMap) {
49
-                    if(!$form->fieldExists($columnMap->getPhpName())) {
48
+                foreach ($i18NTableMap->getColumns() as $columnMap) {
49
+                    if (!$form->fieldExists($columnMap->getPhpName())) {
50 50
                         $fDto = self::parseFormField($domain, $i18NTableMap, $columnMap->getPhpName(), $i18NTableMap->getBehaviors());
51
-                        if(null !== $fDto) {
51
+                        if (null !== $fDto) {
52 52
                             $fDto->pk = false;
53 53
                             $form->addField($fDto);
54 54
                         }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $fDto->entity = $relatedModel;
78 78
         $relatedField = $foreignTable->getColumn($mappedColumn->getRelatedColumnName());
79 79
         $fDto->relatedField = $relatedField->getPhpName();
80
-        $fDto->url = Router::getInstance()->getRoute(strtolower($domain) . '-api-' . $relatedModel);
80
+        $fDto->url = Router::getInstance()->getRoute(strtolower($domain).'-api-'.$relatedModel);
81 81
         return $fDto;
82 82
     }
83 83
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         $column = null;
186 186
         try {
187 187
             $column = $tableMap->getColumnByPhpName($field);
188
-        } catch (\Exception $e) {
188
+        }catch (\Exception $e) {
189 189
             Logger::log($e->getMessage(), LOG_DEBUG);
190 190
             //foreach($tableMap->getRelations() as $relation) {
191 191
             //    $column = self::checkFieldExists($relation->getLocalTable(), $field);
@@ -202,18 +202,18 @@  discard block
 block discarded – undo
202 202
     private static function addQueryFilter(ColumnMap $column, ModelCriteria &$query, $value = null)
203 203
     {
204 204
         $tableField = $column->getFullyQualifiedName();
205
-        if(is_array($value)) {
205
+        if (is_array($value)) {
206 206
             $query->add($tableField, $value, Criteria::IN);
207 207
         } elseif (preg_match('/^\[/', $value) && preg_match('/\]$/', $value)) {
208 208
             $query->add($tableField, explode(',', preg_replace('/(\[|\])/', '', $value)), Criteria::IN);
209 209
         } elseif (preg_match('/^(\'|\")(.*)(\'|\")$/', $value)) {
210 210
             $text = preg_replace('/(\'|\")/', '', $value);
211 211
             $text = preg_replace('/\ /', '%', $text);
212
-            $query->add($tableField, '%' . $text . '%', Criteria::LIKE);
213
-        } else {
214
-            if(null !== $column->getValueSet()) {
212
+            $query->add($tableField, '%'.$text.'%', Criteria::LIKE);
213
+        }else {
214
+            if (null !== $column->getValueSet()) {
215 215
                 $valueSet = $column->getValueSet();
216
-                if(in_array($value, $valueSet)) {
216
+                if (in_array($value, $valueSet)) {
217 217
                     $value = array_search($value, $valueSet);
218 218
                 }
219 219
             }
@@ -233,31 +233,31 @@  discard block
 block discarded – undo
233 233
         $sep = '';
234 234
         foreach ($tableMap->getColumns() as $column) {
235 235
             if ($column->isText()) {
236
-                $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
236
+                $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
237 237
                 $sep = ', " ", ';
238 238
             }
239 239
         }
240
-        foreach($tableMap->getRelations() as $relation) {
241
-            if(preg_match('/I18n$/i', $relation->getName())) {
240
+        foreach ($tableMap->getRelations() as $relation) {
241
+            if (preg_match('/I18n$/i', $relation->getName())) {
242 242
                 $localeTableMap = $relation->getLocalTable();
243 243
                 foreach ($localeTableMap->getColumns() as $column) {
244 244
                     if ($column->isText()) {
245
-                        $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
245
+                        $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
246 246
                         $sep = ', " ", ';
247 247
                     }
248 248
                 }
249 249
             }
250 250
         }
251 251
         foreach ($extraColumns as $extra => $name) {
252
-            if(!preg_match("/(COUNT|DISTINCT|SUM|MAX|MIN|GROUP)/i", $extra)) {
253
-                $exp .= $sep . $extra;
252
+            if (!preg_match("/(COUNT|DISTINCT|SUM|MAX|MIN|GROUP)/i", $extra)) {
253
+                $exp .= $sep.$extra;
254 254
                 $sep = ', " ", ';
255 255
             }
256 256
         }
257 257
         $exp .= ")";
258 258
         $text = preg_replace('/(\'|\")/', '', $value);
259 259
         $text = preg_replace('/\ /', '%', $text);
260
-        $query->where($exp . Criteria::LIKE . '"%' . $text . '%"');
260
+        $query->where($exp.Criteria::LIKE.'"%'.$text.'%"');
261 261
     }
262 262
 
263 263
     /**
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      */
283 283
     public static function extractQuery($modelNameNamespace, ConnectionInterface $con = null)
284 284
     {
285
-        $queryReflector = new \ReflectionClass($modelNameNamespace . "Query");
285
+        $queryReflector = new \ReflectionClass($modelNameNamespace."Query");
286 286
         /** @var \Propel\Runtime\ActiveQuery\ModelCriteria $query */
287 287
         $query = $queryReflector->getMethod('create')->invoke($con);
288 288
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         } elseif ($mappedColumn->isText()) {
312 312
             if ($mappedColumn->getSize() > 100) {
313 313
                 $fDto = self::createField($field, Field::TEXTAREA_TYPE, $required);
314
-            } else {
314
+            }else {
315 315
                 $fDto = self::generateStringField($field, $required);
316 316
             }
317 317
         } elseif ($mappedColumn->getType() === PropelTypes::BOOLEAN) {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     public static function extractPrimaryKeyColumnName(TableMap $tableMap) {
350 350
         $modelPk = null;
351
-        foreach($tableMap->getPrimaryKeys() as $pk) {
351
+        foreach ($tableMap->getPrimaryKeys() as $pk) {
352 352
             $modelPk = $pk;
353 353
             break;
354 354
         }
@@ -357,15 +357,15 @@  discard block
 block discarded – undo
357 357
 
358 358
     private static function mapResult(ActiveRecordInterface $model, array $data = []) {
359 359
         $result = [];
360
-        foreach($data as $key => $value) {
360
+        foreach ($data as $key => $value) {
361 361
             try {
362 362
                 $realValue = $model->getByName($key);
363
-            } catch(\Exception $e) {
363
+            }catch (\Exception $e) {
364 364
                 $realValue = $value;
365 365
             }
366
-            if(Api::API_MODEL_KEY_FIELD === $key) {
366
+            if (Api::API_MODEL_KEY_FIELD === $key) {
367 367
                 $result[$key] = (integer)$realValue;
368
-            } else {
368
+            }else {
369 369
                 $result[$key] = $realValue;
370 370
             }
371 371
         }
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
         $objTableMap = get_class($formatter->getTableMap());
383 383
         /** @var TableMapTrait $objTableMap */
384 384
         $objData = $data;
385
-        foreach($objTableMap::getFieldNames() as $field) {
386
-            if(!array_key_exists($field, $objData)) {
385
+        foreach ($objTableMap::getFieldNames() as $field) {
386
+            if (!array_key_exists($field, $objData)) {
387 387
                 $objData[$field] = null;
388 388
             }
389 389
         }
390 390
         $obj = @$formatter->getAllObjectsFromRow($objData);
391 391
         $result = self::mapResult($obj, $data);
392
-        if(!preg_match('/' . $modelPk->getPhpName() . '/i', $query[Api::API_FIELDS_RESULT_FIELD])) {
392
+        if (!preg_match('/'.$modelPk->getPhpName().'/i', $query[Api::API_FIELDS_RESULT_FIELD])) {
393 393
             unset($result[$modelPk->getPhpName()]);
394 394
         }
395 395
         return $result;
Please login to merge, or discard this patch.
src/base/types/traits/Api/ApiTrait.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     /**
41 41
      * Method that extract the Api name
42
-     * @return mixed
42
+     * @return string
43 43
      */
44 44
     public function getApi()
45 45
     {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     /**
52 52
      * Method that extract the Domain name
53
-     * @return mixed
53
+     * @return string
54 54
      */
55 55
     public function getDomain()
56 56
     {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,9 @@
 block discarded – undo
114 114
                 try {
115 115
                     $query->filterBy($phpName, $pks[$i]);
116 116
                     $i++;
117
-                    if($i >= count($pks)) break;
117
+                    if($i >= count($pks)) {
118
+                        break;
119
+                    }
118 120
                 } catch(\Exception $e) {
119 121
                     Logger::log($e->getMessage(), LOG_DEBUG);
120 122
                 }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
     protected function hydrateBulkRequest() {
97 97
         $class = new \ReflectionClass($this->getModelNamespace());
98 98
         $this->list = [];
99
-        foreach($this->data as $item) {
100
-            if(is_array($item)) {
101
-                if(count($this->list) < Config::getParam('api.block.limit', 1000)) {
99
+        foreach ($this->data as $item) {
100
+            if (is_array($item)) {
101
+                if (count($this->list) < Config::getParam('api.block.limit', 1000)) {
102 102
                     /** @var ActiveRecordInterface $model */
103 103
                     $model = $class->newInstance();
104 104
                     $this->hydrateModelFromRequest($model, $item);
105 105
                     $this->list[] = $model;
106
-                } else {
107
-                    Logger::log(_('Max items per bulk insert raised'), LOG_WARNING, count($this->data) . _('items'));
106
+                }else {
107
+                    Logger::log(_('Max items per bulk insert raised'), LOG_WARNING, count($this->data)._('items'));
108 108
                 }
109 109
             }
110 110
         }
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
      */
116 116
     protected function saveBulk() {
117 117
         $tablemap = $this->getTableMap();
118
-        foreach($this->list as &$model) {
118
+        foreach ($this->list as &$model) {
119 119
             $con = Propel::getWriteConnection($tablemap::DATABASE_NAME);
120 120
             try {
121 121
                 $model->save($con);
122 122
                 $con->commit();
123
-            } catch(\Exception $e) {
123
+            }catch (\Exception $e) {
124 124
                 Logger::log($e->getMessage(), LOG_ERR, $model->toArray());
125 125
                 $con->rollBack();
126 126
             }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     protected function exportList() {
134 134
         $list = [];
135 135
         /** @var ActiveRecordInterface $item */
136
-        foreach($this->list as $item) {
136
+        foreach ($this->list as $item) {
137 137
             $list[] = $item->toArray();
138 138
         }
139 139
         return $list;
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
157 157
      */
158 158
     protected function findPk(ModelCriteria $query, $pk) {
159 159
         $pks = explode(Api::API_PK_SEPARATOR, urldecode($pk));
160
-        if(count($pks) === 1 && !empty($pks[0])) {
160
+        if (count($pks) === 1 && !empty($pks[0])) {
161 161
             $query->filterByPrimaryKey($pks[0]);
162
-        } else {
162
+        }else {
163 163
             $i = 0;
164
-            foreach($this->getPkDbName() as $key => $phpName) {
164
+            foreach ($this->getPkDbName() as $key => $phpName) {
165 165
                 try {
166 166
                     $query->filterBy($phpName, $pks[$i]);
167 167
                     $i++;
168
-                    if($i >= count($pks)) break;
169
-                } catch(\Exception $e) {
168
+                    if ($i >= count($pks)) break;
169
+                }catch (\Exception $e) {
170 170
                     Logger::log($e->getMessage(), LOG_DEBUG);
171 171
                 }
172 172
             }
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
         try {
197 197
             $query = $this->prepareQuery();
198 198
             $this->model = $this->findPk($query, $pk);
199
-        } catch (\Exception $e) {
200
-            Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR);
199
+        }catch (\Exception $e) {
200
+            Logger::log(get_class($this).': '.$e->getMessage(), LOG_ERR);
201 201
         }
202 202
     }
203 203
 
Please login to merge, or discard this patch.
src/base/dto/Form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             return ($aOrder < $bOrder) ? -1 : 1;
49 49
         });
50 50
         $array['actions'] = [];
51
-        foreach($this->actions as $action) {
51
+        foreach ($this->actions as $action) {
52 52
             $array['actions'][] = $action->__toArray();
53 53
         }
54 54
         return $array;
Please login to merge, or discard this patch.
src/base/types/traits/Api/ManagerTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@
 block discarded – undo
39 39
             "domain" => $this->getDomain(),
40 40
             "listLabel" => Api::API_LIST_NAME_FIELD,
41 41
             'modelId' => Api::API_MODEL_KEY_FIELD,
42
-            'formUrl' => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower('admin-api-form-' . $this->getDomain() . '-' . $this->getApi()), TRUE)),
43
-            "url" => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower($this->getDomain() . '-' . 'api-' . $this->getApi() . "-pk"), TRUE)),
42
+            'formUrl' => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower('admin-api-form-'.$this->getDomain().'-'.$this->getApi()), TRUE)),
43
+            "url" => preg_replace('/\/\{(.*)\}$/i', '', $this->getRoute(strtolower($this->getDomain().'-'.'api-'.$this->getApi()."-pk"), TRUE)),
44 44
         ), [], '');
45 45
     }
46 46
 
Please login to merge, or discard this patch.
src/base/types/traits/Api/ConnectionTrait.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Propel\Runtime\Propel;
7 7
 use PSFS\base\config\Config;
8 8
 use PSFS\base\Logger;
9
-use PSFS\base\types\traits\DebugTrait;
10 9
 
11 10
 /**
12 11
  * Trait ConnectionTrait
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $this->con = Propel::getConnection($tableMap::DATABASE_NAME);
34 34
         $this->con->beginTransaction();
35
-        if(method_exists($this->con, 'useDebug')) {
35
+        if (method_exists($this->con, 'useDebug')) {
36 36
             Logger::log('Enabling debug queries mode', LOG_INFO);
37 37
             $this->con->useDebug(Config::getParam('debug'));
38 38
         }
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
      */
46 46
     protected function closeTransaction($status)
47 47
     {
48
-        if(null !== $this->con) {
48
+        if (null !== $this->con) {
49 49
             $this->traceDebugQuery();
50 50
             if (null !== $this->con && $this->con->inTransaction()) {
51 51
                 if ($status === 200) {
52 52
                     $this->con->commit();
53
-                } else {
53
+                }else {
54 54
                     $this->con->rollBack();
55 55
                 }
56 56
             }
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
      * Checks if the connection has a transaction initialized
73 73
      */
74 74
     protected function checkTransaction() {
75
-        if(null !== $this->con && !$this->con->inTransaction()) {
75
+        if (null !== $this->con && !$this->con->inTransaction()) {
76 76
             $this->con->beginTransaction();
77 77
         }
78
-        if(null !== $this->con && $this->con->inTransaction()) {
78
+        if (null !== $this->con && $this->con->inTransaction()) {
79 79
             $this->items++;
80 80
         }
81
-        if($this->items >= Config::getParam('api.block.limit', 1000)) {
81
+        if ($this->items >= Config::getParam('api.block.limit', 1000)) {
82 82
             $this->con->commit();
83 83
             $this->items = 0;
84 84
         }
Please login to merge, or discard this patch.