Test Failed
Push — master ( 31c205...aa4d99 )
by Fran
02:36
created
src/base/types/traits/Helper/FieldModelHelperTrait.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $fDto->entity = $relatedModel;
34 34
         $relatedField = $foreignTable->getColumn($mappedColumn->getRelatedColumnName());
35 35
         $fDto->relatedField = $relatedField->getPhpName();
36
-        $fDto->url = Router::getInstance()->getRoute(strtolower($domain) . '-api-' . $relatedModel);
36
+        $fDto->url = Router::getInstance()->getRoute(strtolower($domain).'-api-'.$relatedModel);
37 37
         return $fDto;
38 38
     }
39 39
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @param ModelCriteria $query
43 43
      * @param mixed $value
44 44
      */
45
-    private static function addQueryFilter(ColumnMap $column, ModelCriteria &$query, $value = null)
45
+    private static function addQueryFilter(ColumnMap $column, ModelCriteria & $query, $value = null)
46 46
     {
47 47
         $tableField = $column->getFullyQualifiedName();
48 48
         if (is_array($value)) {
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
         } elseif (preg_match('/^(\'|\")(.*)(\'|\")$/', $value)) {
53 53
             $text = preg_replace('/(\'|\")/', '', $value);
54 54
             $text = preg_replace('/\ /', '%', $text);
55
-            $query->add($tableField, '%' . $text . '%', Criteria::LIKE);
56
-        } else {
55
+            $query->add($tableField, '%'.$text.'%', Criteria::LIKE);
56
+        }else {
57 57
             if (null !== $column->getValueSet()) {
58 58
                 $valueSet = $column->getValueSet();
59 59
                 if (in_array($value, $valueSet)) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      * @param string $field
72 72
      * @param mixed $value
73 73
      */
74
-    public static function addModelField(TableMap $tableMap, ModelCriteria &$query, $field, $value = null)
74
+    public static function addModelField(TableMap $tableMap, ModelCriteria & $query, $field, $value = null)
75 75
     {
76 76
         if ($column = self::checkFieldExists($tableMap, $field)) {
77 77
             self::addQueryFilter($column, $query, $value);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public static function extractQuery($modelNameNamespace, ConnectionInterface $con = null)
88 88
     {
89
-        $queryReflector = new \ReflectionClass($modelNameNamespace . "Query");
89
+        $queryReflector = new \ReflectionClass($modelNameNamespace."Query");
90 90
         /** @var \Propel\Runtime\ActiveQuery\ModelCriteria $query */
91 91
         $query = $queryReflector->getMethod('create')->invoke($con);
92 92
 
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
      * @param array $extraColumns
100 100
      * @param mixed $value
101 101
      */
102
-    public static function composerComboField(TableMap $tableMap, ModelCriteria &$query, array $extraColumns = [], $value = null)
102
+    public static function composerComboField(TableMap $tableMap, ModelCriteria & $query, array $extraColumns = [], $value = null)
103 103
     {
104 104
         $exp = 'CONCAT(';
105 105
         $sep = '';
106 106
         foreach ($tableMap->getColumns() as $column) {
107 107
             if ($column->isText()) {
108
-                $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
108
+                $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
109 109
                 $sep = ', " ", ';
110 110
             }
111 111
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $localeTableMap = $relation->getLocalTable();
115 115
                 foreach ($localeTableMap->getColumns() as $column) {
116 116
                     if ($column->isText()) {
117
-                        $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
117
+                        $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
118 118
                         $sep = ', " ", ';
119 119
                     }
120 120
                 }
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
         }
123 123
         foreach (array_keys($extraColumns) as $extra) {
124 124
             if (!preg_match("/(COUNT|DISTINCT|SUM|MAX|MIN|GROUP)/i", $extra)) {
125
-                $exp .= $sep . $extra;
125
+                $exp .= $sep.$extra;
126 126
                 $sep = ', " ", ';
127 127
             }
128 128
         }
129 129
         $exp .= ")";
130 130
         $text = preg_replace('/(\'|\")/', '', $value);
131 131
         $text = preg_replace('/\ /', '%', $text);
132
-        $query->where($exp . Criteria::LIKE . '"%' . $text . '%"');
132
+        $query->where($exp.Criteria::LIKE.'"%'.$text.'%"');
133 133
     }
134 134
 
135 135
     /**
Please login to merge, or discard this patch.
src/base/types/traits/Helper/FieldMapperHelperTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
         foreach ($data as $key => $value) {
29 29
             try {
30 30
                 $realValue = $model->getByName($key);
31
-            } catch (\Exception $e) {
31
+            }catch (\Exception $e) {
32 32
                 $realValue = $value;
33 33
             }
34 34
             if (Api::API_MODEL_KEY_FIELD === $key) {
35 35
                 $result[$key] = (integer)$realValue;
36
-            } else {
36
+            }else {
37 37
                 $result[$key] = $realValue;
38 38
             }
39 39
         }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         }
67 67
         $obj = @$formatter->getAllObjectsFromRow($objData);
68 68
         $result = self::mapResult($obj, $data);
69
-        if (!preg_match('/' . $modelPk->getPhpName() . '/i', $query[Api::API_FIELDS_RESULT_FIELD])) {
69
+        if (!preg_match('/'.$modelPk->getPhpName().'/i', $query[Api::API_FIELDS_RESULT_FIELD])) {
70 70
             unset($result[$modelPk->getPhpName()]);
71 71
         }
72 72
         return $result;
Please login to merge, or discard this patch.
src/base/types/traits/Api/Crud/ApiListTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     protected function hydrateOrders()
40 40
     {
41 41
         if (count($this->query)) {
42
-            Logger::log(static::class . ' gathering query string', LOG_DEBUG);
42
+            Logger::log(static::class.' gathering query string', LOG_DEBUG);
43 43
             foreach ($this->query as $key => $value) {
44 44
                 if ($key === self::API_ORDER_FIELD) {
45 45
                     $orders = json_decode($value, true);
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
      */
58 58
     protected function extractPagination()
59 59
     {
60
-        Logger::log(static::class . ' extract pagination start', LOG_DEBUG);
60
+        Logger::log(static::class.' extract pagination start', LOG_DEBUG);
61 61
         $page = array_key_exists(self::API_PAGE_FIELD, $this->query) ? $this->query[self::API_PAGE_FIELD] : 1;
62 62
         $limit = array_key_exists(self::API_LIMIT_FIELD, $this->query) ? $this->query[self::API_LIMIT_FIELD] : 100;
63
-        Logger::log(static::class . ' extract pagination end', LOG_DEBUG);
63
+        Logger::log(static::class.' extract pagination end', LOG_DEBUG);
64 64
         return array($page, (int)$limit);
65 65
     }
66 66
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
      * @param ModelCriteria $query
70 70
      * @throws \PSFS\base\exception\ApiException
71 71
      */
72
-    protected function addOrders(ModelCriteria &$query)
72
+    protected function addOrders(ModelCriteria & $query)
73 73
     {
74
-        Logger::log(static::class . ' extract orders start ', LOG_DEBUG);
74
+        Logger::log(static::class.' extract orders start ', LOG_DEBUG);
75 75
         $orderAdded = FALSE;
76 76
         $tableMap = $this->getTableMap();
77 77
         foreach ($this->order->getOrders() as $field => $direction) {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 $orderAdded = TRUE;
80 80
                 if ($direction === Order::ASC) {
81 81
                     $query->addAscendingOrderByColumn($column->getPhpName());
82
-                } else {
82
+                }else {
83 83
                     $query->addDescendingOrderByColumn($column->getPhpName());
84 84
                 }
85 85
             }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 $query->addAscendingOrderByColumn($key);
91 91
             }
92 92
         }
93
-        Logger::log(static::class . ' extract orders end', LOG_DEBUG);
93
+        Logger::log(static::class.' extract orders end', LOG_DEBUG);
94 94
     }
95 95
 
96 96
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      *
99 99
      * @param ModelCriteria $query
100 100
      */
101
-    protected function addFilters(ModelCriteria &$query)
101
+    protected function addFilters(ModelCriteria & $query)
102 102
     {
103 103
         if (count($this->query) > 0) {
104 104
             $tableMap = $this->getTableMap();
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
             list($page, $limit) = $this->extractPagination();
126 126
             if ($limit === -1) {
127 127
                 $this->list = $query->find($this->con);
128
-            } else {
128
+            }else {
129 129
                 $this->list = $query->paginate($page, $limit, $this->con);
130 130
             }
131 131
             $this->checkReturnFields($this->list->getQuery());
132
-        } catch (\Exception $e) {
132
+        }catch (\Exception $e) {
133 133
             Logger::log($e->getMessage(), LOG_ERR);
134 134
         }
135 135
     }
Please login to merge, or discard this patch.
src/base/types/traits/Api/ApiTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
                     $model = $class->newInstance();
104 104
                     $this->hydrateModelFromRequest($model, $item);
105 105
                     $this->list[] = $model;
106
-                } else {
107
-                    Logger::log(t('Max items per bulk insert raised'), LOG_WARNING, count($this->data) . t('items'));
106
+                }else {
107
+                    Logger::log(t('Max items per bulk insert raised'), LOG_WARNING, count($this->data).t('items'));
108 108
                 }
109 109
             }
110 110
         }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             try {
122 122
                 $model->save($con);
123 123
                 $con->commit();
124
-            } catch (\Exception $e) {
124
+            }catch (\Exception $e) {
125 125
                 Logger::log($e->getMessage(), LOG_ERR, $model->toArray());
126 126
                 $con->rollBack();
127 127
             }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      *
147 147
      * @param ModelCriteria $query
148 148
      */
149
-    protected function joinTables(ModelCriteria &$query)
149
+    protected function joinTables(ModelCriteria & $query)
150 150
     {
151 151
         //TODO for specific implementations
152 152
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $pks = explode(Api::API_PK_SEPARATOR, urldecode($primaryKey));
163 163
         if (count($pks) === 1 && !empty($pks[0])) {
164 164
             $query->filterByPrimaryKey($pks[0]);
165
-        } else {
165
+        }else {
166 166
             $item = 0;
167 167
             foreach ($this->getPkDbName() as $phpName) {
168 168
                 try {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                     if ($item >= count($pks)) {
172 172
                         break;
173 173
                     }
174
-                } catch (\Exception $e) {
174
+                }catch (\Exception $e) {
175 175
                     Logger::log($e->getMessage(), LOG_DEBUG);
176 176
                 }
177 177
             }
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
         try {
203 203
             $query = $this->prepareQuery();
204 204
             $this->model = $this->findPk($query, $primaryKey);
205
-        } catch (\Exception $e) {
206
-            Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR);
205
+        }catch (\Exception $e) {
206
+            Logger::log(get_class($this).': '.$e->getMessage(), LOG_ERR);
207 207
         }
208 208
     }
209 209
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     /**
225 225
      * @param ModelCriteria $query
226 226
      */
227
-    protected function checkReturnFields(ModelCriteria &$query)
227
+    protected function checkReturnFields(ModelCriteria & $query)
228 228
     {
229 229
         $returnFields = Request::getInstance()->getQuery(Api::API_FIELDS_RESULT_FIELD);
230 230
         if (null !== $returnFields) {
Please login to merge, or discard this patch.
src/base/types/traits/Api/MutationTrait.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         if (count($pks) === 1) {
100 100
             $pks = array_keys($pks);
101 101
             return [
102
-                $tableMap::TABLE_NAME . '.' . $pks[0] => Api::API_MODEL_KEY_FIELD
102
+                $tableMap::TABLE_NAME.'.'.$pks[0] => Api::API_MODEL_KEY_FIELD
103 103
             ];
104 104
         }
105 105
         if (count($pks) > 1) {
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
             $principal = '';
108 108
             $sep = 'CONCAT(';
109 109
             foreach ($pks as $pk) {
110
-                $apiPks[$tableMap::TABLE_NAME . '.' . $pk->getName()] = $pk->getPhpName();
111
-                $principal .= $sep . $tableMap::TABLE_NAME . '.' . $pk->getName();
112
-                $sep = ', "' . Api::API_PK_SEPARATOR . '", ';
110
+                $apiPks[$tableMap::TABLE_NAME.'.'.$pk->getName()] = $pk->getPhpName();
111
+                $principal .= $sep.$tableMap::TABLE_NAME.'.'.$pk->getName();
112
+                $sep = ', "'.Api::API_PK_SEPARATOR.'", ';
113 113
             }
114 114
             $principal .= ')';
115 115
             $apiPks[$principal] = Api::API_MODEL_KEY_FIELD;
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
         $pks = '';
137 137
         $sep = '';
138 138
         foreach ($tableMap->getPrimaryKeys() as $pk) {
139
-            $pks .= $sep . $pk->getFullyQualifiedName();
139
+            $pks .= $sep.$pk->getFullyQualifiedName();
140 140
             $sep = ', "|", ';
141 141
         }
142
-        $this->extraColumns['CONCAT("' . $tableMap->getPhpName() . ' #", ' . $pks . ')'] = Api::API_LIST_NAME_FIELD;
142
+        $this->extraColumns['CONCAT("'.$tableMap->getPhpName().' #", '.$pks.')'] = Api::API_LIST_NAME_FIELD;
143 143
     }
144 144
 
145 145
     /**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             }
162 162
             if (null !== $column) {
163 163
                 $this->extraColumns[$column->getFullyQualifiedName()] = Api::API_LIST_NAME_FIELD;
164
-            } else {
164
+            }else {
165 165
                 $this->addClassListName($tableMap);
166 166
             }
167 167
         }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      * @param $action
173 173
      * @throws ApiException
174 174
      */
175
-    private function addExtraColumns(ModelCriteria &$query, $action)
175
+    private function addExtraColumns(ModelCriteria & $query, $action)
176 176
     {
177 177
         if (Api::API_ACTION_LIST === $action) {
178 178
             $this->addDefaultListField();
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         if (!empty($this->extraColumns)) {
182 182
             if (Config::getParam('api.extrafields.compat', true)) {
183 183
                 $fields = array_values($this->extraColumns);
184
-            } else {
184
+            }else {
185 185
                 $returnFields = Request::getInstance()->getQuery(Api::API_FIELDS_RESULT_FIELD);
186 186
                 $fields = explode(',', $returnFields ?: '');
187 187
                 $fields[] = self::API_MODEL_KEY_FIELD;
@@ -215,22 +215,22 @@  discard block
 block discarded – undo
215 215
     /**
216 216
      * @param ModelCriteria $query
217 217
      */
218
-    protected function checkI18n(ModelCriteria &$query)
218
+    protected function checkI18n(ModelCriteria & $query)
219 219
     {
220 220
         $this->extractApiLang();
221 221
         $model = $this->getModelNamespace();
222
-        $modelI18n = $model . 'I18n';
222
+        $modelI18n = $model.'I18n';
223 223
         if (method_exists($query, 'useI18nQuery')) {
224 224
             $query->useI18nQuery($this->lang);
225 225
             $modelParts = explode('\\', $modelI18n);
226
-            $i18nMapClass = str_replace(end($modelParts), 'Map\\' . end($modelParts), $modelI18n) . 'TableMap';
226
+            $i18nMapClass = str_replace(end($modelParts), 'Map\\'.end($modelParts), $modelI18n).'TableMap';
227 227
             /** @var TableMap $modelI18nTableMap */
228 228
             $modelI18nTableMap = $i18nMapClass::getTableMap();
229 229
             foreach ($modelI18nTableMap->getColumns() as $columnMap) {
230 230
                 if (!$columnMap->isPrimaryKey()) {
231 231
                     $query->withColumn($columnMap->getFullyQualifiedName(), ApiHelper::getColumnMapName($columnMap));
232 232
                 } elseif (!$columnMap->isForeignKey()) {
233
-                    $query->withColumn('IFNULL(' . $columnMap->getFullyQualifiedName() . ', "' . $this->lang . '")', ApiHelper::getColumnMapName($columnMap));
233
+                    $query->withColumn('IFNULL('.$columnMap->getFullyQualifiedName().', "'.$this->lang.'")', ApiHelper::getColumnMapName($columnMap));
234 234
                 }
235 235
             }
236 236
         }
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
         $model->fromArray($data, ApiHelper::getFieldTypes());
246 246
         $tableMap = $this->getTableMap();
247 247
         try {
248
-            if ($tableMap->hasRelation($tableMap->getPhpName() . 'I18n')) {
249
-                $relateI18n = $tableMap->getRelation($tableMap->getPhpName() . 'I18n');
248
+            if ($tableMap->hasRelation($tableMap->getPhpName().'I18n')) {
249
+                $relateI18n = $tableMap->getRelation($tableMap->getPhpName().'I18n');
250 250
                 $i18NTableMap = $relateI18n->getLocalTable();
251 251
                 $model->setLocale(array_key_exists('Locale', $data) ? $data['Locale'] : (array_key_exists('locale', $data) ? $data['locale'] : Request::header(Api::HEADER_API_LANG, 'es_ES')));
252 252
                 foreach ($i18NTableMap->getColumns() as $columnMap) {
253
-                    $method = 'set' . $columnMap->getPhpName();
253
+                    $method = 'set'.$columnMap->getPhpName();
254 254
                     $dtoColumnName = ApiHelper::getColumnMapName($columnMap);
255 255
                     if (array_key_exists($dtoColumnName, $data)
256 256
                         && method_exists($model, $method)
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                     }
260 260
                 }
261 261
             }
262
-        } catch (Exception $e) {
262
+        }catch (Exception $e) {
263 263
             Logger::log($e->getMessage(), LOG_DEBUG);
264 264
         }
265 265
     }
Please login to merge, or discard this patch.
src/base/types/traits/Api/ConnectionTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
             if (null !== $this->con && $this->con->inTransaction()) {
53 53
                 if ($status === 200) {
54 54
                     $this->con->commit();
55
-                } else {
55
+                }else {
56 56
                     $this->con->rollBack();
57 57
                 }
58 58
             }
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
@@ -12,5 +12,5 @@
 block discarded – undo
12 12
     }
13 13
 
14 14
     define('PSFS_BOOSTRAP_TRAT_LOADED', true);
15
-    require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'bootstrap.php';
15
+    require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'bootstrap.php';
16 16
 }
Please login to merge, or discard this patch.
src/base/types/helpers/FileHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      * @param string $path
17 17
      * @return int|bool
18 18
      */
19
-    public static function writeFile(string $path, mixed $data): int|bool
19
+    public static function writeFile(string $path, mixed $data): int | bool
20 20
     {
21 21
         return @file_put_contents($path, $data);
22 22
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @param string $path
26 26
      * @return string|bool
27 27
      */
28
-    public static function readFile(string $path): string|bool
28
+    public static function readFile(string $path): string | bool
29 29
     {
30 30
         $data = false;
31 31
         if (file_exists($path)) {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public static function generateHashFilename(string $verb, string $slug, array $query = []): string
44 44
     {
45
-        return sha1(strtolower($verb) . ' ' . $slug . ' ' . strtolower(http_build_query($query)));
45
+        return sha1(strtolower($verb).' '.$slug.' '.strtolower(http_build_query($query)));
46 46
     }
47 47
 
48 48
     /**
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $class = GeneratorHelper::extractClassFromNamespace($action['class']);
56 56
         $filename = self::generateHashFilename($action['http'], $action['slug'], $query);
57
-        $subPath = substr($filename, 0, 2) . DIRECTORY_SEPARATOR . substr($filename, 2, 2);
58
-        return $action['module'] . DIRECTORY_SEPARATOR . $class . DIRECTORY_SEPARATOR . $action['method'] . DIRECTORY_SEPARATOR . $subPath . DIRECTORY_SEPARATOR;
57
+        $subPath = substr($filename, 0, 2).DIRECTORY_SEPARATOR.substr($filename, 2, 2);
58
+        return $action['module'].DIRECTORY_SEPARATOR.$class.DIRECTORY_SEPARATOR.$action['method'].DIRECTORY_SEPARATOR.$subPath.DIRECTORY_SEPARATOR;
59 59
     }
60 60
 
61 61
     /**
Please login to merge, or discard this patch.
src/base/config/ConfigForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@
 block discarded – undo
84 84
             'icon' => 'fa-plus',
85 85
         ];
86 86
         if (Config::getParam('admin.version', 'v1') === 'v1') {
87
-            $add['onclick'] = 'javascript:addNewField(document.getElementById("' . $this->getName() . '"));';
88
-        } else {
87
+            $add['onclick'] = 'javascript:addNewField(document.getElementById("'.$this->getName().'"));';
88
+        }else {
89 89
             $add['ng-click'] = 'addNewField()';
90 90
         }
91 91
         $this->addButton('submit', t('Guardar configuración'), 'submit', array(
Please login to merge, or discard this patch.