diff --git a/src/Cron.php b/src/Cron.php index 0d5d8ac..601c442 100644 --- a/src/Cron.php +++ b/src/Cron.php @@ -66,7 +66,7 @@ class Cron implements CronInterface { $license_ids = $this->licenseStorage->getLicenseIdsToExpire($time); if ($license_ids) { $queue_storage = $this->entityTypeManager->getStorage('advancedqueue_queue'); - /** @var \Drupal\advancedqueue\Entity\QueueInterface $recurring_queue */ + /** @var \Drupal\advancedqueue\Entity\QueueInterface $queue */ $queue = $queue_storage->load('commerce_license'); foreach ($license_ids as $license_id) { // Create a job and queue each one up. diff --git a/src/LicenseStorage.php b/src/LicenseStorage.php index 722cb51..c037e8f 100644 --- a/src/LicenseStorage.php +++ b/src/LicenseStorage.php @@ -61,10 +61,7 @@ class LicenseStorage extends CommerceContentEntityStorage implements LicenseStor /** * {@inheritdoc} */ - public function getLicenseIdsToExpire($time = NULL) { - if (!$time) { - $time = time(); - } + public function getLicenseIdsToExpire($time) { // Get all of the active expired licenses. // Ones we've already revoked will be marked expired. $query = \Drupal::entityQuery('commerce_license') diff --git a/src/LicenseStorageInterface.php b/src/LicenseStorageInterface.php index 35e8026..ae74c2b 100644 --- a/src/LicenseStorageInterface.php +++ b/src/LicenseStorageInterface.php @@ -49,9 +49,12 @@ interface LicenseStorageInterface extends ContentEntityStorageInterface { /** * Returns the ids of licenses that need to be expired. * + * @param int $time + * The timestamp to be used for expiry check. + * * @return array * A list of license ids to be expired. */ - public function getLicenseIdsToExpire(); + public function getLicenseIdsToExpire($time); }