From 990663cd6071d4e13e879bc6bd24ddaf39f97d0b Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 5 Feb 2016 12:11:57 -0700 Subject: [PATCH] use ConsoleCommand --- system/src/Grav/Console/Cli/CleanCommand.php | 28 +++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/system/src/Grav/Console/Cli/CleanCommand.php b/system/src/Grav/Console/Cli/CleanCommand.php index ff6d28614..37ad8a3b7 100644 --- a/system/src/Grav/Console/Cli/CleanCommand.php +++ b/system/src/Grav/Console/Cli/CleanCommand.php @@ -2,7 +2,7 @@ namespace Grav\Console\Cli; use Grav\Common\Filesystem\Folder; -use Symfony\Component\Console\Command\Command; +use Grav\Console\ConsoleCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -12,7 +12,7 @@ use Symfony\Component\Console\Formatter\OutputFormatterStyle; * Class CleanCommand * @package Grav\Console\Cli */ -class CleanCommand extends Command +class CleanCommand extends ConsoleCommand { /* @var InputInterface $output */ protected $input; @@ -186,10 +186,8 @@ class CleanCommand extends Command /** * @return int|null|void */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function serve() { - $this->setupConsole($input, $output); - $this->cleanPaths(); } @@ -214,24 +212,4 @@ class CleanCommand extends Command } } - /** - * Set colors style definition for the formatter. - * - * @param InputInterface $input - * @param OutputInterface $output - */ - public function setupConsole(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - - $this->output->getFormatter()->setStyle('normal', new OutputFormatterStyle('white')); - $this->output->getFormatter()->setStyle('yellow', new OutputFormatterStyle('yellow', null, array('bold'))); - $this->output->getFormatter()->setStyle('red', new OutputFormatterStyle('red', null, array('bold'))); - $this->output->getFormatter()->setStyle('cyan', new OutputFormatterStyle('cyan', null, array('bold'))); - $this->output->getFormatter()->setStyle('green', new OutputFormatterStyle('green', null, array('bold'))); - $this->output->getFormatter()->setStyle('magenta', new OutputFormatterStyle('magenta', null, array('bold'))); - $this->output->getFormatter()->setStyle('white', new OutputFormatterStyle('white', null, array('bold'))); - } - }