use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Dumper;
use Symfony\Component\Yaml\Parser;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Core\Command\Command;
use Drupal\Console\Core\Utils\ConfigurationManager;
use Drupal\Console\Core\Utils\NestedArray;
-use Drupal\Console\Core\Style\DrupalStyle;
/**
* Class SetCommand
*/
class SetCommand extends Command
{
- use CommandTrait;
-
/**
* @var ConfigurationManager
*/
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
$parser = new Parser();
$dumper = new Dumper();
);
if (!file_exists($userConfigFile)) {
- $io->error(
+ $this->getIo()->error(
sprintf(
$this->trans('commands.settings.set.messages.missing-file'),
$userConfigFile
file_get_contents($userConfigFile)
);
} catch (\Exception $e) {
- $io->error(
+ $this->getIo()->error(
$this->trans(
'commands.settings.set.messages.error-parsing'
) . ': ' . $e->getMessage()
try {
$userConfigFileDump = $dumper->dump($userConfigFileParsed, 10);
} catch (\Exception $e) {
- $io->error(
+ $this->getIo()->error(
[
$this->trans('commands.settings.set.messages.error-generating'),
$e->getMessage()
$translatorLanguage = $this->getApplication()->getTranslator()->getLanguage();
if ($translatorLanguage != $settingValue) {
- $io->error(
+ $this->getIo()->error(
sprintf(
$this->trans('commands.settings.set.messages.missing-language'),
$settingValue
try {
file_put_contents($userConfigFile, $userConfigFileDump);
} catch (\Exception $e) {
- $io->error(
+ $this->getIo()->error(
[
$this->trans('commands.settings.set.messages.error-writing'),
$e->getMessage()
return 1;
}
- $io->success(
+ $this->getIo()->success(
sprintf(
$this->trans('commands.settings.set.messages.success'),
$settingName,