File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -305,20 +305,19 @@ public function extractAttributeValuesFromResult($result, $attribute) {
305305 * @return array If a range was detected with keys 'values', 'attributeName',
306306 * 'attributeFull' and 'rangeHigh', otherwise empty.
307307 */
308- public function extractRangeData ($ result , $ attribute ) {
308+ public function extractRangeData (array $ result , string $ attribute ): array {
309309 $ keys = array_keys ($ result );
310310 foreach ($ keys as $ key ) {
311311 if ($ key !== $ attribute && str_starts_with ((string )$ key , $ attribute )) {
312312 $ queryData = explode ('; ' , (string )$ key );
313- if (str_starts_with ($ queryData [1 ], 'range= ' )) {
313+ if ($ queryData && isset ( $ queryData [ 1 ]) && str_starts_with ($ queryData [1 ], 'range= ' )) {
314314 $ high = substr ($ queryData [1 ], 1 + strpos ($ queryData [1 ], '- ' ));
315- $ data = [
315+ return [
316316 'values ' => $ result [$ key ],
317317 'attributeName ' => $ queryData [0 ],
318318 'attributeFull ' => $ key ,
319319 'rangeHigh ' => $ high ,
320320 ];
321- return $ data ;
322321 }
323322 }
324323 }
You can’t perform that action at this time.
0 commit comments