prestashop helperform undefined index id error

It is the because the array key is missing

 

'type' => 'switch',
'label' => $this->trans('Status', [], 'Admin.Global'),
'name' => 'active',
'id' => 'active',
'values' => [
[
'id' => 'active_on', //#### this key is missing and caused the index id error
'value' => 1,
'label' => $this->trans('Yes', [], 'Admin.Global'),
],
[
'id' => 'active_off', //#### this key is missing and caused the index id error
'value' => 0,
'label' => $this->trans('No', [], 'Admin.Global'),
],
],
],
],