@@ -163,14 +163,19 @@ protected function prepareWidgetLabel($objAttribute)
163163 'GET: ' . $ this ->getParamName ()
164164 );
165165
166- if ($ this ->get ('fromfield ' ) && $ this ->get ('tofield ' )) {
166+ $ fromField = $ this ->get ('fromfield ' );
167+ $ toField = $ this ->get ('tofield ' );
168+ if ($ fromField && $ toField ) {
167169 $ arrLabel [0 ] .= ' ' . $ GLOBALS ['TL_LANG ' ]['metamodels_frontendfilter ' ]['fromto ' ];
168- } elseif ($ this ->get ('fromfield ' ) && !$ this ->get ('tofield ' )) {
170+ return $ arrLabel ;
171+ }
172+ if ($ fromField && !$ toField ) {
169173 $ arrLabel [0 ] .= ' ' . $ GLOBALS ['TL_LANG ' ]['metamodels_frontendfilter ' ]['from ' ];
170- } else {
171- $ arrLabel [0 ] .= ' ' . $ GLOBALS ['TL_LANG ' ]['metamodels_frontendfilter ' ]['to ' ];
174+ return $ arrLabel ;
172175 }
173176
177+ $ arrLabel [0 ] .= ' ' . $ GLOBALS ['TL_LANG ' ]['metamodels_frontendfilter ' ]['to ' ];
178+
174179 return $ arrLabel ;
175180 }
176181
@@ -195,7 +200,7 @@ protected function prepareWidgetOptions($arrIds, $objAttribute)
195200 $ mixOption = strip_tags ($ mixOption );
196201 $ mixOption = trim ($ mixOption );
197202
198- if ($ mixOption === '' || $ mixOption === null ) {
203+ if ('' === $ mixOption || null === $ mixOption ) {
199204 unset($ arrOptions [$ mixKeyOption ]);
200205 }
201206 }
@@ -229,13 +234,13 @@ protected function prepareWidgetParamAndFilterUrl($arrFilterUrl)
229234 if ($ parameterValue && ($ parameterValue [0 ] || $ parameterValue [1 ])) {
230235 $ privateFilterUrl [$ parameterName ] = $ parameterValue ;
231236
232- return array ($ privateFilterUrl , $ parameterValue );
233- } else {
234- // No values given, clear the array.
235- $ parameterValue = null ;
236-
237237 return array ($ privateFilterUrl , $ parameterValue );
238238 }
239+
240+ // No values given, clear the array.
241+ $ parameterValue = null ;
242+
243+ return array ($ privateFilterUrl , $ parameterValue );
239244 }
240245
241246 return array ($ privateFilterUrl , $ parameterValue );
@@ -265,7 +270,7 @@ protected function getFilterWidgetParameters(IAttribute $attribute, $currentValu
265270 'size ' => ($ this ->get ('fromfield ' ) && $ this ->get ('tofield ' ) ? 2 : 1 ),
266271 'urlparam ' => $ this ->getParamName (),
267272 'template ' => $ this ->get ('template ' ),
268- 'colname ' => $ attribute ->getColname (),
273+ 'colname ' => $ attribute ->getColName (),
269274 ),
270275 // We need to implode to have it transported correctly in the frontend filter.
271276 'urlvalue ' => !empty ($ currentValue ) ? implode ('__ ' , $ currentValue ) : ''
@@ -274,9 +279,6 @@ protected function getFilterWidgetParameters(IAttribute $attribute, $currentValu
274279
275280 /**
276281 * {@inheritdoc}
277- *
278- * @SuppressWarnings(PHPMD.Superglobals)
279- * @SuppressWarnings(PHPMD.CamelCaseVariableName)
280282 */
281283 public function getParameterFilterWidgets (
282284 $ arrIds ,
0 commit comments