protected static function prepareAttributes(&$attributes = [])
{
foreach ($attributes as $key => $setting) {
if (!is_array($setting) || ArrayHelper::getValue($setting, 'visible', true) !== true) {
unset($attributes[$key]);
} elseif (isset($setting['attributes'])) {
static::prepareAttributes($setting['attributes']);
}
}
}