5 * Contains \Drupal\Console\Command\Debug\MigrateCommand.
8 namespace Drupal\Console\Command\Debug;
10 use Symfony\Component\Console\Input\InputArgument;
11 use Symfony\Component\Console\Input\InputInterface;
12 use Symfony\Component\Console\Output\OutputInterface;
13 use Drupal\Console\Command\Shared\MigrationTrait;
14 use Drupal\Console\Annotations\DrupalCommand;
15 use Drupal\Console\Core\Command\Command;
16 use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
20 * extension = "migrate",
21 * extensionType = "module"
24 class MigrateCommand extends Command
29 * @var MigrationPluginManagerInterface $pluginManagerMigration
31 protected $pluginManagerMigration;
34 * MigrateCommand constructor.
36 * @param MigrationPluginManagerInterface $pluginManagerMigration
38 public function __construct(
39 MigrationPluginManagerInterface $pluginManagerMigration
41 $this->pluginManagerMigration = $pluginManagerMigration;
42 parent::__construct();
45 protected function configure()
48 ->setName('debug:migrate')
49 ->setDescription($this->trans('commands.debug.migrate.description'))
52 InputArgument::OPTIONAL,
53 $this->trans('commands.debug.migrate.arguments.tag')
55 ->setAliases(['mid']);
58 protected function execute(InputInterface $input, OutputInterface $output)
60 $drupal_version = 'Drupal ' . $input->getArgument('tag');
62 $migrations = $this->getMigrations($drupal_version);
66 $this->trans('commands.debug.migrate.messages.id'),
67 $this->trans('commands.debug.migrate.messages.description'),
68 $this->trans('commands.debug.migrate.messages.tags'),
72 if (empty($migrations)) {
73 $this->getIo()->error(
75 $this->trans('commands.debug.migrate.messages.no-migrations'),
80 foreach ($migrations as $migration_id => $migration) {
81 $tableRows[] = [$migration_id, $migration['description'], $migration['tags']];
83 $this->getIo()->table($tableHeader, $tableRows, 'compact');