Skip to content

Commit

Permalink
3380 relocate to debug module commands (#3409)
Browse files Browse the repository at this point in the history
* Move migrate:debug to debug:migrate

* Move rest:debug to debug:rest

* Move test:debug to debug:test

* Move features:debug to debug:features
  • Loading branch information
mauhg authored and jmolivas committed Jul 6, 2017
1 parent de04f6b commit c8830e2
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 88 deletions.
23 changes: 23 additions & 0 deletions config/services/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,26 @@ services:
tags:
- { name: drupal.command }
lazy: true
console.migrate_debug:
class: Drupal\Console\Command\Debug\MigrateCommand
arguments: ['@?plugin.manager.migration']
tags:
- { name: drupal.command }
lazy: true
console.rest_debug:
class: Drupal\Console\Command\Debug\RestCommand
arguments: ['@?plugin.manager.rest']
tags:
- { name: drupal.command }
lazy: true
console.test_debug:
class: Drupal\Console\Command\Debug\TestCommand
arguments: ['@?test_discovery']
tags:
- { name: drupal.command }
lazy: true
console.feature_debug:
class: Drupal\Console\Command\Debug\FeaturesCommand
tags:
- { name: drupal.command }
lazy: true
5 changes: 0 additions & 5 deletions config/services/feature.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
services:
console.feature_debug:
class: Drupal\Console\Command\Features\DebugCommand
tags:
- { name: drupal.command }
lazy: true
console.feature_import:
class: Drupal\Console\Command\Features\ImportCommand
tags:
Expand Down
6 changes: 0 additions & 6 deletions config/services/migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ services:
tags:
- { name: drupal.command }
lazy: true
console.migrate_debug:
class: Drupal\Console\Command\Migrate\DebugCommand
arguments: ['@?plugin.manager.migration']
tags:
- { name: drupal.command }
lazy: true
console.migrate_setup:
class: Drupal\Console\Command\Migrate\SetupCommand
arguments: ['@state', '@?plugin.manager.migration']
Expand Down
6 changes: 0 additions & 6 deletions config/services/rest.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
services:
console.rest_debug:
class: Drupal\Console\Command\Rest\DebugCommand
arguments: ['@?plugin.manager.rest']
tags:
- { name: drupal.command }
lazy: true
console.rest_disable:
class: Drupal\Console\Command\Rest\DisableCommand
arguments: ['@config.factory', '@?plugin.manager.rest']
Expand Down
6 changes: 0 additions & 6 deletions config/services/simpletest.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
services:
console.test_debug:
class: Drupal\Console\Command\Test\DebugCommand
arguments: ['@?test_discovery']
tags:
- { name: drupal.command }
lazy: true
console.test_run:
class: Drupal\Console\Command\Test\RunCommand
arguments: ['@app.root', '@?test_discovery', '@module_handler', '@date.formatter']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Features\DebugCommand.
* Contains \Drupal\Console\Command\Debug\FeaturesCommand.
*/

namespace Drupal\Console\Command\Features;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -23,20 +23,20 @@
* )
*/

class DebugCommand extends Command
class FeaturesCommand extends Command
{
use CommandTrait;
use FeatureTrait;

protected function configure()
{
$this
->setName('features:debug')
->setDescription($this->trans('commands.features.debug.description'))
->setName('debug:features')
->setDescription($this->trans('commands.debug.features.description'))
->addArgument(
'bundle',
InputArgument::OPTIONAL,
$this->trans('commands.features.debug.arguments.bundle')
$this->trans('commands.debug.features.arguments.bundle')
);
}

Expand All @@ -46,17 +46,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$bundle= $input->getArgument('bundle');

$tableHeader = [
$this->trans('commands.features.debug.messages.bundle'),
$this->trans('commands.features.debug.messages.name'),
$this->trans('commands.features.debug.messages.machine_name'),
$this->trans('commands.features.debug.messages.status'),
$this->trans('commands.features.debug.messages.state'),
$this->trans('commands.debug.features.messages.bundle'),
$this->trans('commands.debug.features.messages.name'),
$this->trans('commands.debug.features.messages.machine_name'),
$this->trans('commands.debug.features.messages.status'),
$this->trans('commands.debug.features.messages.state'),
];

$tableRows = [];

$features = $this->getFeatureList($io, $bundle);

foreach ($features as $feature) {
$tableRows[] = [$feature['bundle_name'],$feature['name'], $feature['machine_name'], $feature['status'],$feature['state']];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Migrate\DebugCommand.
* Contains \Drupal\Console\Command\Debug\MigrateCommand.
*/

namespace Drupal\Console\Command\Migrate;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -23,7 +23,7 @@
* extensionType = "module"
* )
*/
class DebugCommand extends Command
class MigrateCommand extends Command
{
use MigrationTrait;
use CommandTrait;
Expand All @@ -34,7 +34,7 @@ class DebugCommand extends Command
protected $pluginManagerMigration;

/**
* DebugCommand constructor.
* MigrateCommand constructor.
*
* @param MigrationPluginManagerInterface $pluginManagerMigration
*/
Expand All @@ -48,12 +48,12 @@ public function __construct(
protected function configure()
{
$this
->setName('migrate:debug')
->setDescription($this->trans('commands.migrate.debug.description'))
->setName('debug:migrate')
->setDescription($this->trans('commands.debug.migrate.description'))
->addArgument(
'tag',
InputArgument::OPTIONAL,
$this->trans('commands.migrate.debug.arguments.tag')
$this->trans('commands.debug.migrate.arguments.tag')
)
->setAliases(['mid']);
}
Expand All @@ -62,21 +62,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new DrupalStyle($input, $output);
$drupal_version = 'Drupal ' . $input->getArgument('tag');

$migrations = $this->getMigrations($drupal_version);


$tableHeader = [
$this->trans('commands.migrate.debug.messages.id'),
$this->trans('commands.migrate.debug.messages.description'),
$this->trans('commands.migrate.debug.messages.tags'),
$this->trans('commands.debug.migrate.messages.id'),
$this->trans('commands.debug.migrate.messages.description'),
$this->trans('commands.debug.migrate.messages.tags'),
];

$tableRows = [];
if (empty($migrations)) {
$io->error(
sprintf(
$this->trans('commands.migrate.debug.messages.no-migrations'),
$this->trans('commands.debug.migrate.messages.no-migrations'),
count($migrations)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Command\Rest\DebugCommand.
* Contains \Drupal\Console\Command\Debug\RestCommand.
*/

namespace Drupal\Console\Command\Rest;
namespace Drupal\Console\Command\Debug;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -24,7 +24,7 @@
* extensionType = "module"
* )
*/
class DebugCommand extends Command
class RestCommand extends Command
{
use CommandTrait;
use RestTrait;
Expand All @@ -35,7 +35,7 @@ class DebugCommand extends Command
protected $pluginManagerRest;

/**
* DebugCommand constructor.
* RestCommand constructor.
*
* @param ResourcePluginManager $pluginManagerRest
*/
Expand All @@ -48,18 +48,18 @@ public function __construct(ResourcePluginManager $pluginManagerRest)
protected function configure()
{
$this
->setName('rest:debug')
->setDescription($this->trans('commands.rest.debug.description'))
->setName('debug:rest')
->setDescription($this->trans('commands.debug.rest.description'))
->addArgument(
'resource-id',
InputArgument::OPTIONAL,
$this->trans('commands.rest.debug.arguments.resource-id')
$this->trans('commands.debug.rest.arguments.resource-id')
)
->addOption(
'authorization',
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.rest.debug.options.status')
$this->trans('commands.debug.rest.options.status')
)
->setAliases(['rede']);
}
Expand Down Expand Up @@ -89,7 +89,7 @@ private function restDetail(DrupalStyle $io, $resource_id)
if (empty($plugin)) {
$io->error(
sprintf(
$this->trans('commands.rest.debug.messages.not-found'),
$this->trans('commands.debug.rest.messages.not-found'),
$resource_id
)
);
Expand All @@ -101,24 +101,24 @@ private function restDetail(DrupalStyle $io, $resource_id)

$configuration = [];
$configuration[] = [
$this->trans('commands.rest.debug.messages.id'),
$this->trans('commands.debug.rest.messages.id'),
$resource['id']
];
$configuration[] = [
$this->trans('commands.rest.debug.messages.label'),
$this->trans('commands.debug.rest.messages.label'),
(string) $resource['label']
];
$configuration[] = [
$this->trans('commands.rest.debug.messages.canonical_url'),
$this->trans('commands.debug.rest.messages.canonical_url'),
$resource['uri_paths']['canonical']
];
$configuration[] = [
$this->trans('commands.rest.debug.messages.status'),
(isset($config[$resource['id']])) ? $this->trans('commands.rest.debug.messages.enabled') : $this->trans('commands.rest.debug.messages.disabled')];
$this->trans('commands.debug.rest.messages.status'),
(isset($config[$resource['id']])) ? $this->trans('commands.debug.rest.messages.enabled') : $this->trans('commands.debug.rest.messages.disabled')];
$configuration[] = [
$this->trans(
sprintf(
'commands.rest.debug.messages.provider',
'commands.debug.rest.messages.provider',
$resource['provider']
)
)
Expand All @@ -130,9 +130,9 @@ private function restDetail(DrupalStyle $io, $resource_id)
$io->table([], $configuration, 'compact');

$tableHeader = [
$this->trans('commands.rest.debug.messages.rest-state'),
$this->trans('commands.rest.debug.messages.supported-formats'),
$this->trans('commands.rest.debug.messages.supported_auth'),
$this->trans('commands.debug.rest.messages.rest-state'),
$this->trans('commands.debug.rest.messages.supported-formats'),
$this->trans('commands.debug.rest.messages.supported_auth'),
];

$tableRows = [];
Expand All @@ -152,11 +152,11 @@ protected function restList(DrupalStyle $io, $status)
$rest_resources = $this->getRestResources($status);

$tableHeader = [
$this->trans('commands.rest.debug.messages.id'),
$this->trans('commands.rest.debug.messages.label'),
$this->trans('commands.rest.debug.messages.canonical_url'),
$this->trans('commands.rest.debug.messages.status'),
$this->trans('commands.rest.debug.messages.provider'),
$this->trans('commands.debug.rest.messages.id'),
$this->trans('commands.debug.rest.messages.label'),
$this->trans('commands.debug.rest.messages.canonical_url'),
$this->trans('commands.debug.rest.messages.status'),
$this->trans('commands.debug.rest.messages.provider'),
];

$tableRows = [];
Expand Down
Loading

0 comments on commit c8830e2

Please sign in to comment.