Closed
Description
I have the following code
$wrapper_id = $field_id . '_wrapper';
if (!isset($form[$field_id]) && isset($form[$wrapper_id])) {
$element = &$form[$wrapper_id][$field_id];
} else {
$element = &$form[$field_id];
}
$element['test'] = 'test';
(Last line added to illustrate that the variable is indeed "used").
It reports that $element
is an unused variable in the first line it appears.
If I initialize $element
the phpcs warning is gone but it should be possible to declare a variable like that.