uri; // $message = 'Creating Styles ...'; $results = array(); $results[] = $item->style->createDerivative($item->uri, $item->destination); $context['message'] = $item->uri . ' processed.'; $context['results'][] = $item->destination; } public static function createStylesFinishedCallback($success, $results, $operations) { // The 'success' parameter means no fatal PHP errors were detected. All // other error management should be handled using 'results'. if ($success) { $message = \Drupal::translation()->formatPlural( count($results), 'One image processed.', '@count image processed.' ); } else { $message = t('Finished with an error.'); } drupal_set_message($message); } }