Convert variable_set to d8 variables i have a variable_set  defined in d6 as follows :

variable_set('cleanupeditform_formkeys', array(
 'menu' =&gt; t('Menu settings'),
 'revision_information' =&gt; t('Revision information'),
 'attachments' =&gt; t('File attachments'),
 'comment_settings' =&gt; t('Comment settings'),
 'author' =&gt; t('Authoring information'),
 'options' =&gt; t('Publishing options'),
 ));


How i can convert to drupal 8 form ? I know for a single case it would be like 

\Drupal::state()-&gt;set('cleanupeditform_formkeys','my_value');


Thanks .
It's no different, you can also save an array in state:

\Drupal::state()-&gt;set('cleanupeditform_formkeys', ['foo' =&gt; 'bar']);