5 * Contains \Drupal\Console\Command\Migrate\DebugCommand.
8 namespace Drupal\Console\Command\Migrate;
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\Core\Style\DrupalStyle;
15 use Drupal\Console\Annotations\DrupalCommand;
16 use Symfony\Component\Console\Command\Command;
17 use Drupal\Console\Core\Command\Shared\CommandTrait;
18 use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
22 * extension = "migrate",
23 * extensionType = "module"
27 class DebugCommand extends Command
33 * @var MigrationPluginManagerInterface $pluginManagerMigration
35 protected $pluginManagerMigration;
38 * DebugCommand constructor.
40 * @param MigrationPluginManagerInterface $pluginManagerMigration
42 public function __construct(MigrationPluginManagerInterface $pluginManagerMigration)
44 $this->pluginManagerMigration = $pluginManagerMigration;
45 parent::__construct();
48 protected function configure()
51 ->setName('migrate:debug')
52 ->setDescription($this->trans('commands.migrate.debug.description'))
55 InputArgument::OPTIONAL,
56 $this->trans('commands.migrate.debug.arguments.tag')
60 protected function execute(InputInterface $input, OutputInterface $output)
62 $io = new DrupalStyle($input, $output);
63 $drupal_version = 'Drupal ' . $input->getArgument('tag');
65 $migrations = $this->getMigrations($drupal_version);
69 $this->trans('commands.migrate.debug.messages.id'),
70 $this->trans('commands.migrate.debug.messages.description'),
71 $this->trans('commands.migrate.debug.messages.tags'),
75 if (empty($migrations)) {
78 $this->trans('commands.migrate.debug.messages.no-migrations'),
83 foreach ($migrations as $migration_id => $migration) {
84 $tableRows[] = [$migration_id, $migration['description'], $migration['tags']];
86 $io->table($tableHeader, $tableRows, 'compact');