ConsoleEvent.php
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace IAWP_SCOPED\Symfony\Component\Console\Event; |
| 12 | |
| 13 | use IAWP_SCOPED\Symfony\Component\Console\Command\Command; |
| 14 | use IAWP_SCOPED\Symfony\Component\Console\Input\InputInterface; |
| 15 | use IAWP_SCOPED\Symfony\Component\Console\Output\OutputInterface; |
| 16 | use IAWP_SCOPED\Symfony\Contracts\EventDispatcher\Event; |
| 17 | /** |
| 18 | * Allows to inspect input and output of a command. |
| 19 | * |
| 20 | * @author Francesco Levorato <git@flevour.net> |
| 21 | */ |
| 22 | class ConsoleEvent extends Event |
| 23 | { |
| 24 | protected $command; |
| 25 | private $input; |
| 26 | private $output; |
| 27 | public function __construct(?Command $command, InputInterface $input, OutputInterface $output) |
| 28 | { |
| 29 | $this->command = $command; |
| 30 | $this->input = $input; |
| 31 | $this->output = $output; |
| 32 | } |
| 33 | /** |
| 34 | * Gets the command that is executed. |
| 35 | * |
| 36 | * @return Command|null |
| 37 | */ |
| 38 | public function getCommand() |
| 39 | { |
| 40 | return $this->command; |
| 41 | } |
| 42 | /** |
| 43 | * Gets the input instance. |
| 44 | * |
| 45 | * @return InputInterface |
| 46 | */ |
| 47 | public function getInput() |
| 48 | { |
| 49 | return $this->input; |
| 50 | } |
| 51 | /** |
| 52 | * Gets the output instance. |
| 53 | * |
| 54 | * @return OutputInterface |
| 55 | */ |
| 56 | public function getOutput() |
| 57 | { |
| 58 | return $this->output; |
| 59 | } |
| 60 | } |
| 61 |