use Drupal\Core\State\StateInterface;
/**
* The state store.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;
/**
* Drush command constructor.
*
* @param \Drupal\Core\State\StateInterface $state
* The state store.
*/
public function __construct(StateInterface $state) {
$this->state = $state;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('state'),
);
}
...
$this->state->set('mystate', 111);