Passed
Push — master ( 08a67e...6063b2 )
by Fran
07:56
created
src/Dispatcher.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,16 +69,16 @@
 block discarded – undo
69 69
                 if (!Request::getInstance()->isFile()) {
70 70
                     return $this->router->execute($this->actualUri);
71 71
                 }
72
-            } else {
72
+            }else {
73 73
                 return ConfigController::getInstance()->config();
74 74
             }
75
-        } catch (AdminCredentialsException $a) {
75
+        }catch (AdminCredentialsException $a) {
76 76
             return UserController::showAdminManager();
77
-        } catch (SecurityException $s) {
77
+        }catch (SecurityException $s) {
78 78
             return $this->security->notAuthorized($this->actualUri);
79
-        } catch (RouterException $r) {
79
+        }catch (RouterException $r) {
80 80
             return $this->router->httpNotFound($r);
81
-        } catch (\Exception $e) {
81
+        }catch (\Exception $e) {
82 82
             return $this->dumpException($e);
83 83
         }
84 84
     }
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/Request.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     /**
56 56
      * Método que verifica si existe una cabecera concreta
57
-     * @param $header
57
+     * @param string $header
58 58
      *
59 59
      * @return boolean
60 60
      */
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      *
176 176
      * @param string $queryParams
177 177
      *
178
-     * @return mixed
178
+     * @return string
179 179
      */
180 180
     public function getQuery($queryParams)
181 181
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public static function header($name, $default = null)
114 114
     {
115
-        return self::getInstance()->getHeader($name,  $default);
115
+        return self::getInstance()->getHeader($name, $default);
116 116
     }
117 117
 
118 118
     /**
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
         $header = null;
126 126
         if ($this->hasHeader($name)) {
127 127
             $header = $this->header[$name];
128
-        } else if(array_key_exists('h_' . strtolower($name), $this->query)) {
129
-            $header = $this->query['h_' . strtolower($name)];
128
+        }else if (array_key_exists('h_'.strtolower($name), $this->query)) {
129
+            $header = $this->query['h_'.strtolower($name)];
130 130
         }
131 131
         return $header ?: $default;
132 132
     }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     {
225 225
         if (null === $url) $url = $this->getServer('HTTP_ORIGIN');
226 226
         ob_start();
227
-        header('Location: ' . $url);
227
+        header('Location: '.$url);
228 228
         ob_end_clean();
229 229
         Security::getInstance()->updateSession();
230 230
         exit(_("Redireccionando..."));
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
     {
269 269
         $url = $this->getServerName();
270 270
         $protocol = $protocol ? $this->getProtocol() : '';
271
-        if (!empty($protocol)) $url = $protocol . $url;
271
+        if (!empty($protocol)) $url = $protocol.$url;
272 272
         if (!in_array($this->getServer('SERVER_PORT'), [80, 443])) {
273
-            $url .= ':' . $this->getServer('SERVER_PORT');
273
+            $url .= ':'.$this->getServer('SERVER_PORT');
274 274
         }
275 275
         return $url;
276 276
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,7 +222,9 @@  discard block
 block discarded – undo
222 222
      */
223 223
     public function redirect($url = null)
224 224
     {
225
-        if (null === $url) $url = $this->getServer('HTTP_ORIGIN');
225
+        if (null === $url) {
226
+            $url = $this->getServer('HTTP_ORIGIN');
227
+        }
226 228
         ob_start();
227 229
         header('Location: ' . $url);
228 230
         ob_end_clean();
@@ -268,7 +270,9 @@  discard block
 block discarded – undo
268 270
     {
269 271
         $url = $this->getServerName();
270 272
         $protocol = $protocol ? $this->getProtocol() : '';
271
-        if (!empty($protocol)) $url = $protocol . $url;
273
+        if (!empty($protocol)) {
274
+            $url = $protocol . $url;
275
+        }
272 276
         if (!in_array($this->getServer('SERVER_PORT'), [80, 443])) {
273 277
             $url .= ':' . $this->getServer('SERVER_PORT');
274 278
         }
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   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -31,19 +31,19 @@  discard block
 block discarded – undo
31 31
         $behaviors = $tableMap->getBehaviors();
32 32
         foreach ($map::getFieldNames() as $field) {
33 33
             $fDto = self::parseFormField($domain, $tableMap, $field, $behaviors);
34
-            if(null !== $fDto) {
34
+            if (null !== $fDto) {
35 35
                 $form->addField($fDto);
36 36
             }
37 37
         }
38 38
 
39
-        if(array_key_exists('i18n', $behaviors)) {
40
-            $relateI18n = $tableMap->getRelation($tableMap->getPhpName() . 'I18n');
41
-            if(null !== $relateI18n) {
39
+        if (array_key_exists('i18n', $behaviors)) {
40
+            $relateI18n = $tableMap->getRelation($tableMap->getPhpName().'I18n');
41
+            if (null !== $relateI18n) {
42 42
                 $i18NTableMap = $relateI18n->getLocalTable();
43
-                foreach($i18NTableMap->getColumns() as $columnMap) {
44
-                    if(!$form->fieldExists($columnMap->getPhpName())) {
43
+                foreach ($i18NTableMap->getColumns() as $columnMap) {
44
+                    if (!$form->fieldExists($columnMap->getPhpName())) {
45 45
                         $fDto = self::parseFormField($domain, $i18NTableMap, $columnMap->getPhpName(), $i18NTableMap->getBehaviors());
46
-                        if(null !== $fDto) {
46
+                        if (null !== $fDto) {
47 47
                             $fDto->pk = false;
48 48
                             $form->addField($fDto);
49 49
                         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $fDto->entity = $relatedModel;
73 73
         $relatedField = $foreignTable->getColumn($mappedColumn->getRelatedColumnName());
74 74
         $fDto->relatedField = $relatedField->getPhpName();
75
-        $fDto->url = Router::getInstance()->getRoute(strtolower($domain) . '-api-' . $relatedModel);
75
+        $fDto->url = Router::getInstance()->getRoute(strtolower($domain).'-api-'.$relatedModel);
76 76
         return $fDto;
77 77
     }
78 78
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $column = null;
181 181
         try {
182 182
             $column = $tableMap->getColumnByPhpName($field);
183
-        } catch (\Exception $e) {
183
+        }catch (\Exception $e) {
184 184
             Logger::log($e->getMessage(), LOG_WARNING);
185 185
             //foreach($tableMap->getRelations() as $relation) {
186 186
             //    $column = self::checkFieldExists($relation->getLocalTable(), $field);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      * @param ModelCriteria $query
195 195
      * @param mixed $value
196 196
      */
197
-    private static function addQueryFilter(ColumnMap $column, ModelCriteria &$query, $value = null)
197
+    private static function addQueryFilter(ColumnMap $column, ModelCriteria & $query, $value = null)
198 198
     {
199 199
         $tableField = $column->getFullyQualifiedName();
200 200
         if (preg_match('/^<=/', $value)) {
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
         } elseif (preg_match('/^(\'|\")(.*)(\'|\")$/', $value)) {
211 211
             $text = preg_replace('/(\'|\")/', '', $value);
212 212
             $text = preg_replace('/\ /', '%', $text);
213
-            $query->add($tableField, '%' . $text . '%', Criteria::LIKE);
214
-        } else {
213
+            $query->add($tableField, '%'.$text.'%', Criteria::LIKE);
214
+        }else {
215 215
             $query->add($tableField, $value, Criteria::EQUAL);
216 216
         }
217 217
     }
@@ -222,35 +222,35 @@  discard block
 block discarded – undo
222 222
      * @param array $extraColumns
223 223
      * @param mixed $value
224 224
      */
225
-    public static function composerComboField(TableMap $tableMap, ModelCriteria &$query, array $extraColumns = [], $value = null)
225
+    public static function composerComboField(TableMap $tableMap, ModelCriteria & $query, array $extraColumns = [], $value = null)
226 226
     {
227 227
         $exp = 'CONCAT(';
228 228
         $sep = '';
229 229
         foreach ($tableMap->getColumns() as $column) {
230 230
             if ($column->isText()) {
231
-                $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
231
+                $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
232 232
                 $sep = ', " ", ';
233 233
             }
234 234
         }
235
-        foreach($tableMap->getRelations() as $relation) {
236
-            if(preg_match('/I18n$/i', $relation->getName())) {
235
+        foreach ($tableMap->getRelations() as $relation) {
236
+            if (preg_match('/I18n$/i', $relation->getName())) {
237 237
                 $localeTableMap = $relation->getLocalTable();
238 238
                 foreach ($localeTableMap->getColumns() as $column) {
239 239
                     if ($column->isText()) {
240
-                        $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
240
+                        $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
241 241
                         $sep = ', " ", ';
242 242
                     }
243 243
                 }
244 244
             }
245 245
         }
246 246
         foreach ($extraColumns as $extra => $name) {
247
-            $exp .= $sep . $extra;
247
+            $exp .= $sep.$extra;
248 248
             $sep = ', " ", ';
249 249
         }
250 250
         $exp .= ")";
251 251
         $text = preg_replace('/(\'|\")/', '', $value);
252 252
         $text = preg_replace('/\ /', '%', $text);
253
-        $query->where($exp . Criteria::LIKE . '"%' . $text . '%"');
253
+        $query->where($exp.Criteria::LIKE.'"%'.$text.'%"');
254 254
     }
255 255
 
256 256
     /**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      * @param string $field
261 261
      * @param mixed $value
262 262
      */
263
-    public static function addModelField(TableMap $tableMap, ModelCriteria &$query, $field, $value = null)
263
+    public static function addModelField(TableMap $tableMap, ModelCriteria & $query, $field, $value = null)
264 264
     {
265 265
         if ($column = self::checkFieldExists($tableMap, $field)) {
266 266
             self::addQueryFilter($column, $query, $value);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      */
276 276
     public static function extractQuery($modelNameNamespace, ConnectionInterface $con = null)
277 277
     {
278
-        $queryReflector = new \ReflectionClass($modelNameNamespace . "Query");
278
+        $queryReflector = new \ReflectionClass($modelNameNamespace."Query");
279 279
         /** @var \Propel\Runtime\ActiveQuery\ModelCriteria $query */
280 280
         $query = $queryReflector->getMethod('create')->invoke($con);
281 281
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         } elseif ($mappedColumn->isText()) {
305 305
             if ($mappedColumn->getSize() > 100) {
306 306
                 $fDto = self::createField($field, Field::TEXTAREA_TYPE, $required);
307
-            } else {
307
+            }else {
308 308
                 $fDto = self::generateStringField($field, $required);
309 309
             }
310 310
         } elseif ($mappedColumn->getType() === PropelTypes::BOOLEAN) {
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   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
      */
96 96
     protected function hydrateBulkRequest() {
97 97
         $class = new \ReflectionClass($this->getModelNamespace());
98
-        foreach($this->data as $item) {
99
-            if(count($this->list) < Config::getParam('api.block.limit', 1000)) {
98
+        foreach ($this->data as $item) {
99
+            if (count($this->list) < Config::getParam('api.block.limit', 1000)) {
100 100
                 /** @var ActiveRecordInterface $model */
101 101
                 $model = $class->newInstance();
102 102
                 $this->hydrateModelFromRequest($model, $item);
103 103
                 $this->list[] = $model;
104
-            } else {
105
-                Logger::log(_('Max items per bulk insert raised'), LOG_WARNING, count($this->data) . _('items'));
104
+            }else {
105
+                Logger::log(_('Max items per bulk insert raised'), LOG_WARNING, count($this->data)._('items'));
106 106
             }
107 107
         }
108 108
     }
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
      */
113 113
     protected function saveBulk() {
114 114
         $tablemap = $this->getTableMap();
115
-        foreach($this->list as &$model) {
115
+        foreach ($this->list as &$model) {
116 116
             $con = Propel::getWriteConnection($tablemap::DATABASE_NAME);
117 117
             try {
118 118
                 $model->save($con);
119 119
                 $con->commit();
120
-            } catch(\Exception $e) {
120
+            }catch (\Exception $e) {
121 121
                 Logger::log($e->getMessage(), LOG_ERR, $model->toArray());
122 122
                 $con->rollBack();
123 123
             }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     protected function exportList() {
131 131
         $list = [];
132 132
         /** @var ActiveRecordInterface $item */
133
-        foreach($this->list as $item) {
133
+        foreach ($this->list as $item) {
134 134
             $list[] = $item->toArray();
135 135
         }
136 136
         return $list;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      *
142 142
      * @param ModelCriteria $query
143 143
      */
144
-    protected function joinTables(ModelCriteria &$query)
144
+    protected function joinTables(ModelCriteria & $query)
145 145
     {
146 146
         //TODO for specific implementations
147 147
     }
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
      */
155 155
     protected function findPk(ModelCriteria $query, $pk) {
156 156
         $pks = explode(Api::API_PK_SEPARATOR, urldecode($pk));
157
-        if(count($pks) == 1 && !empty($pks[0])) {
157
+        if (count($pks) == 1 && !empty($pks[0])) {
158 158
             $model = $query->findPk($pks[0], $this->con);
159
-        } else {
159
+        }else {
160 160
             $i = 0;
161
-            foreach($this->getPkDbName() as $key => $phpName) {
161
+            foreach ($this->getPkDbName() as $key => $phpName) {
162 162
                 try {
163 163
                     $query->filterBy($phpName, $pks[$i]);
164 164
                     $i++;
165
-                    if($i >= count($pks)) break;
166
-                } catch(\Exception $e) {
165
+                    if ($i >= count($pks)) break;
166
+                }catch (\Exception $e) {
167 167
                     Logger::log($e->getMessage(), LOG_DEBUG);
168 168
                 }
169 169
             }
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
         try {
194 194
             $query = $this->prepareQuery();
195 195
             $this->model = $this->findPk($query, $pk);
196
-        } catch (\Exception $e) {
197
-            Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR);
196
+        }catch (\Exception $e) {
197
+            Logger::log(get_class($this).': '.$e->getMessage(), LOG_ERR);
198 198
         }
199 199
     }
200 200
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     /**
216 216
      * @param ModelCriteria $query
217 217
      */
218
-    protected function checkReturnFields(ModelCriteria &$query)
218
+    protected function checkReturnFields(ModelCriteria & $query)
219 219
     {
220 220
         $returnFields = Request::getInstance()->getQuery(Api::API_FIELDS_RESULT_FIELD);
221 221
         if (null !== $returnFields) {
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.