You are here

function sms_cron in SMS Framework 8

Same name and namespace in other branches
  1. 2.x sms.module \sms_cron()
  2. 2.1.x sms.module \sms_cron()

Implements hook_cron().

File

./sms.module, line 14
Provides hooks for SMS Framework.

Code

function sms_cron() {

  /** @var \Drupal\sms\Provider\PhoneNumberVerificationInterface $phone_number_verification */
  $phone_number_verification_provider = \Drupal::service('sms.phone_number.verification');
  $phone_number_verification_provider
    ->purgeExpiredVerifications();

  /** @var \Drupal\sms\Provider\SmsQueueProcessorInterface $sms_queue_processor */
  $sms_queue_processor = \Drupal::service('sms.queue');
  $sms_queue_processor
    ->processUnqueued();
  $sms_queue_processor
    ->garbageCollection();
}