Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Console\Event; Chris@0: Chris@0: use Symfony\Component\Console\Command\Command; Chris@0: use Symfony\Component\Console\Input\InputInterface; Chris@0: use Symfony\Component\Console\Output\OutputInterface; Chris@0: use Symfony\Component\EventDispatcher\Event; Chris@0: Chris@0: /** Chris@0: * Allows to inspect input and output of a command. Chris@0: * Chris@0: * @author Francesco Levorato Chris@0: */ Chris@0: class ConsoleEvent extends Event Chris@0: { Chris@0: protected $command; Chris@0: Chris@0: private $input; Chris@0: private $output; Chris@0: Chris@14: public function __construct(Command $command = null, InputInterface $input, OutputInterface $output) Chris@0: { Chris@0: $this->command = $command; Chris@0: $this->input = $input; Chris@0: $this->output = $output; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets the command that is executed. Chris@0: * Chris@14: * @return Command|null A Command instance Chris@0: */ Chris@0: public function getCommand() Chris@0: { Chris@0: return $this->command; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets the input instance. Chris@0: * Chris@0: * @return InputInterface An InputInterface instance Chris@0: */ Chris@0: public function getInput() Chris@0: { Chris@0: return $this->input; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets the output instance. Chris@0: * Chris@0: * @return OutputInterface An OutputInterface instance Chris@0: */ Chris@0: public function getOutput() Chris@0: { Chris@0: return $this->output; Chris@0: } Chris@0: }