You are here

public static function GenerateBatch::finished in File Hash 8

Batch finish callback.

File

src/Batch/GenerateBatch.php, line 62

Class

GenerateBatch
Generates file hashes in bulk.

Namespace

Drupal\filehash\Batch

Code

public static function finished($success, $results, $operations) {
  $variables = [
    '@processed' => $results['processed'],
  ];
  if ($success) {
    \Drupal::messenger()
      ->addMessage(t('Processed @processed files.', $variables));
  }
  else {
    \Drupal::messenger()
      ->addWarning(t('An error occurred after processing @processed files.', $variables));
  }
}