public static function ProcessFormExtra::batchFinished in Module Builder 8.3
Implements callback_batch_finished().
Overrides ProcessForm::batchFinished
File
- module_builder_devel/
src/ Form/ ProcessFormExtra.php, line 28
Class
- ProcessFormExtra
- Replaces the code analysis form to add message about time taken.
Namespace
Drupal\module_builder_devel\FormCode
public static function batchFinished($success, $results, $operations) {
parent::batchFinished($success, $results, $operations);
$start_time = $results['start_time'];
$end_time = \Drupal::time()
->getRequestTime();
$duration = $end_time - $start_time;
\Drupal::messenger()
->addStatus(t("Code analysis took @minutes minutes @seconds seconds.", [
'@minutes' => floor($duration / 60),
'@seconds' => $duration % 60,
]));
}