You are here

public function UpgradeStatusCommands::analyze in Upgrade Status 8.3

Same name and namespace in other branches
  1. 8.2 src/Commands/UpgradeStatusCommands.php \Drupal\upgrade_status\Commands\UpgradeStatusCommands::analyze()

Analyze projects output as ASCII.

@command upgrade_status:analyze @option all Analyze all projects. @option skip-existing Return results from a previous scan of a project if available, otherwise start a new one. @option ignore-uninstalled Ignore uninstalled projects. @option ignore-contrib Ignore contributed projects. @option ignore-custom Ignore custom projects. @aliases us-a

Parameters

array $projects: List of projects to analyze.

array $options: Additional options for the command.

Throws

\InvalidArgumentException Thrown when one of the passed arguments is invalid or no arguments were provided.

File

src/Commands/UpgradeStatusCommands.php, line 144

Class

UpgradeStatusCommands
Upgrade Status Drush command

Namespace

Drupal\upgrade_status\Commands

Code

public function analyze(array $projects, array $options = [
  'all' => FALSE,
  'skip-existing' => FALSE,
  'ignore-uninstalled' => FALSE,
  'ignore-contrib' => FALSE,
  'ignore-custom' => FALSE,
]) {
  $extensions = $this
    ->doAnalyze($projects, $options);
  foreach ($extensions as $type => $list) {
    $this
      ->output()
      ->writeln('');
    $this
      ->output()
      ->writeln(str_pad('', 80, '='));
    foreach ($list as $name => $extension) {
      $result = $this->resultFormatter
        ->getRawResult($extension);
      if (is_null($result)) {
        $this
          ->logger()
          ->error('Project scan @name failed.', [
          '@name' => $name,
        ]);
        continue;
      }
      $output = $this
        ->formatDrushStdoutResult($extension);
      foreach ($output as $line) {
        $this
          ->output()
          ->writeln($line);
      }
    }
  }
}