You are here

protected static function Schedule::state in Backup and Migrate 5.0.x

Return the state service.

Easier to replace in unit tests than mocking the actual state service.

Return value

\Drupal\Core\State\StateInterface The state service.

File

src/Entity/Schedule.php, line 199

Class

Schedule
Defines the Schedule entity.

Namespace

Drupal\backup_migrate\Entity

Code

protected static function state() : StateInterface {
  if (empty(static::$state)) {
    static::$state = \Drupal::state();
  }
  return static::$state;
}