You are here

function upgrade_rector_upgrade_status_operations_alter in Upgrade Rector 8

Implements hook_upgrade_status_operations_alter().

File

./upgrade_rector.module, line 90

Code

function upgrade_rector_upgrade_status_operations_alter(&$operations, FormStateInterface $form_state) {

  // Duplicate each operation with another one that runs rector on the
  // same extension.
  if (!empty($form_state
    ->getValue('run_rector'))) {
    $keys = array_keys($operations);
    foreach ($keys as $key) {
      $operations[] = [
        'update_rector_run_rector_batch',
        [
          $operations[$key][1][0],
        ],
      ];
    }
  }
}