Skip to content

Commit

Permalink
3380 relocate to debug namespace (hechoendrupal#183)
Browse files Browse the repository at this point in the history
* Move site:debug to debug:site

* Move chain:debug to debug:chain

* Move settings:debug to debug:settings
  • Loading branch information
mauhg authored and jmolivas committed Jul 6, 2017
1 parent 9e8c3df commit 3cb2000
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion config/dist/aliases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ commands:
- rod
router:rebuild:
- ror
site:debug:
debug:site:
- sd
site:install:
- si
Expand Down
6 changes: 3 additions & 3 deletions services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
tags:
- { name: drupal.command }
console.settings_debug:
class: Drupal\Console\Core\Command\Settings\DebugCommand
class: Drupal\Console\Core\Command\Debug\SettingsCommand
arguments: ['@console.configuration_manager', '@console.nested_array']
tags:
- { name: drupal.command }
Expand All @@ -74,12 +74,12 @@ services:
tags:
- { name: drupal.command }
console.chain_debug:
class: Drupal\Console\Core\Command\Chain\ChainDebugCommand
class: Drupal\Console\Core\Command\Debug\ChainCommand
arguments: ['@console.chain_discovery']
tags:
- { name: drupal.command }
console.site_debug:
class: Drupal\Console\Core\Command\Site\DebugCommand
class: Drupal\Console\Core\Command\Debug\SiteCommand
arguments: ['@console.configuration_manager']
tags:
- { name: drupal.command }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Core\Command\Chain\ChainDebugCommand.
* Contains \Drupal\Console\Core\Command\Debug\ChainCommand.
*/

namespace Drupal\Console\Core\Command\Chain;
namespace Drupal\Console\Core\Command\Debug;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -15,11 +15,11 @@
use Drupal\Console\Core\Command\Shared\CommandTrait;

/**
* Class ChainDebugCommand
* Class ChainCommand
*
* @package Drupal\Console\Core\Command\Chain
* @package Drupal\Console\Core\Command\Debug
*/
class ChainDebugCommand extends Command
class ChainCommand extends Command
{
use CommandTrait;

Expand All @@ -29,7 +29,7 @@ class ChainDebugCommand extends Command
protected $chainDiscovery;

/**
* ChainDebugCommand constructor.
* ChainCommand constructor.
*
* @param ChainDiscovery $chainDiscovery
*/
Expand All @@ -47,8 +47,8 @@ public function __construct(
protected function configure()
{
$this
->setName('chain:debug')
->setDescription($this->trans('commands.chain.debug.description'));
->setName('debug:chain')
->setDescription($this->trans('commands.debug.chain.description'));
}

/**
Expand All @@ -60,11 +60,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$files = $this->chainDiscovery->getChainFiles();

foreach ($files as $directory => $chainFiles) {
$io->info($this->trans('commands.chain.debug.messages.directory'), false);
$io->info($this->trans('commands.debug.chain.messages.directory'), false);
$io->comment($directory);

$tableHeader = [
$this->trans('commands.chain.debug.messages.file')
$this->trans('commands.debug.chain.messages.file')
];

$tableRows = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Core\Command\Settings\DebugCommand.
* Contains \Drupal\Console\Core\Command\Debug\SettingsCommand.
*/

namespace Drupal\Console\Core\Command\Settings;
namespace Drupal\Console\Core\Command\Debug;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -16,11 +16,11 @@
use Drupal\Console\Core\Style\DrupalStyle;

/**
* Class DebugCommand
* Class SettingsCommand
*
* @package Drupal\Console\Core\Command\Settings
*/
class DebugCommand extends Command
class SettingsCommand extends Command
{
use CommandTrait;

Expand Down Expand Up @@ -55,8 +55,8 @@ public function __construct(
protected function configure()
{
$this
->setName('settings:debug')
->setDescription($this->trans('commands.settings.debug.description'));
->setName('debug:settings')
->setDescription($this->trans('commands.debug.settings.description'));
}

/**
Expand Down Expand Up @@ -85,8 +85,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
);

$tableHeader = [
$this->trans('commands.settings.debug.messages.config-key'),
$this->trans('commands.settings.debug.messages.config-value'),
$this->trans('commands.debug.settings.messages.config-key'),
$this->trans('commands.debug.settings.messages.config-value'),
];

$tableRows = [];
Expand All @@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->info(
sprintf(
'%s :',
$this->trans('commands.settings.debug.messages.config-file')
$this->trans('commands.debug.settings.messages.config-file')
),
false
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @file
* Contains \Drupal\Console\Core\Command\Site\DebugCommand.
* Contains \Drupal\Console\Core\Command\Debug\SiteCommand.
*/

namespace Drupal\Console\Core\Command\Site;
namespace Drupal\Console\Core\Command\Debug;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -17,11 +17,11 @@
use Drupal\Console\Core\Style\DrupalStyle;

/**
* Class SiteDebugCommand
* Class SiteCommand
*
* @package Drupal\Console\Core\Command\Site
* @package Drupal\Console\Core\Command\Debug
*/
class DebugCommand extends Command
class SiteCommand extends Command
{
use CommandTrait;

Expand All @@ -31,7 +31,7 @@ class DebugCommand extends Command
protected $configurationManager;

/**
* DebugCommand constructor.
* SiteCommand constructor.
*
* @param ConfigurationManager $configurationManager
*/
Expand All @@ -48,21 +48,21 @@ public function __construct(
public function configure()
{
$this
->setName('site:debug')
->setDescription($this->trans('commands.site.debug.description'))
->setName('debug:site')
->setDescription($this->trans('commands.debug.site.description'))
->addArgument(
'target',
InputArgument::OPTIONAL,
$this->trans('commands.site.debug.options.target'),
$this->trans('commands.debug.site.options.target'),
null
)
->addArgument(
'property',
InputArgument::OPTIONAL,
$this->trans('commands.site.debug.options.property'),
$this->trans('commands.debug.site.options.property'),
null
)
->setHelp($this->trans('commands.site.debug.help'));
->setHelp($this->trans('commands.debug.site.help'));
}

/**
Expand All @@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$sites = array_keys($this->configurationManager->getSites());

if (!$sites) {
$io->error($this->trans('commands.site.debug.messages.invalid-sites'));
$io->error($this->trans('commands.debug.site.messages.invalid-sites'));

return 1;
}
Expand All @@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$target = $input->getArgument('target');
if (!$target) {
$tableHeader =[
$this->trans('commands.site.debug.messages.site'),
$this->trans('commands.debug.site.messages.site'),
];

$io->table($tableHeader, $sites);
Expand All @@ -95,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$targetConfig = $this->configurationManager->readTarget($target);
if (!$targetConfig) {
$io->error($this->trans('commands.site.debug.messages.invalid-site'));
$io->error($this->trans('commands.debug.site.messages.invalid-site'));

return 1;
}
Expand Down

0 comments on commit 3cb2000

Please sign in to comment.