- Issue created by @Nicoc
- Status changed to Needs review
12 months ago 3:20pm 2 January 2024 - Status changed to Needs work
12 months ago 3:29pm 2 January 2024 - 🇮🇹Italy apaderno Brescia, 🇮🇹
+ if (array_key_exists('display_options', $display) && + array_key_exists('style', $display['display_options']) && + array_key_exists('options', $display['display_options']['style']) && + !isset($display['display_options']['style']['options']['pattern_variant'])) { + $displays[$key]['display_options']['style']['options'] = $this->update9101PrepareNewSettings($display['display_options']['style']['options']);
isset($display['display_options']['style']['options'])
is sufficient. There is no need to callarray_key_exists()
three times.+ if(array_key_exists($pattern, $styleSettings['variants'])) { + $styleSettings['pattern_variant'] = $styleSettings['variants'][$pattern]; + unset($styleSettings['variants']); + }
Notice that
array_key_exists()
returnsTRUE
when the key is set toNULL
. It is better to useisset()
, which returnsFALSE
when the key isNULL
.