Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ApiGen\EventDispatcher, Console changes
- Loading branch information
1 parent
dbbc495
commit f23e683
Showing
10 changed files
with
109 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the ApiGen (http://apigen.org) | ||
* | ||
* For the full copyright and license information, please view | ||
* the file LICENSE that was distributed with this source code. | ||
*/ | ||
|
||
namespace ApiGen\Console\Event; | ||
|
||
use ApiGen\Contracts\EventDispatcher\Event\EventInterface; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Event\ConsoleCommandEvent as BaseConsoleCommandEvent; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
|
||
class ConsoleCommandEvent extends BaseConsoleCommandEvent implements EventInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $name; | ||
|
||
|
||
public function __construct($name, Command $command, InputInterface $input, OutputInterface $output) | ||
{ | ||
$this->name = $name; | ||
parent::__construct($command, $input, $output); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the ApiGen (http://apigen.org) | ||
* | ||
* For the full copyright and license information, please view | ||
* the file LICENSE that was distributed with this source code. | ||
*/ | ||
|
||
namespace ApiGen\Console\EventSubscriber; | ||
|
||
use ApiGen\Console\Event\ConsoleCommandEvent; | ||
use ApiGen\Console\IOInterface; | ||
use ApiGen\Contracts\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\Console\ConsoleEvents; | ||
|
||
|
||
class ConsoleIoSubscriber implements EventSubscriberInterface | ||
{ | ||
|
||
/** | ||
* @var IOInterface | ||
*/ | ||
private $consoleIO; | ||
|
||
|
||
public function __construct(IOInterface $consoleIO) | ||
{ | ||
$this->consoleIO = $consoleIO; | ||
} | ||
|
||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getSubscribedEvents() | ||
{ | ||
return [ConsoleEvents::COMMAND => 'setupConsoleIo']; | ||
} | ||
|
||
|
||
public function setupConsoleIo(ConsoleCommandEvent $event) | ||
{ | ||
$this->consoleIO->setInput($event->getInput()); | ||
$this->consoleIO->setOutput($event->getOutput()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
extensions: | ||
- ApiGen\DI\ApiGenExtension | ||
- ApiGen\EventDispatcher\DI\EventDispatcherExtension | ||
- ApiGen\Parser\DI\ParserExtension | ||
- ApiGen\Utils\DI\UtilsExtension | ||
- Kdyby\Events\DI\EventsExtension |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
extensions: | ||
- ApiGen\DI\ApiGenExtension | ||
- ApiGen\EventDispatcher\DI\EventDispatcherExtension | ||
- ApiGen\Parser\DI\ParserExtension | ||
- ApiGen\Utils\DI\UtilsExtension | ||
- Kdyby\Events\DI\EventsExtension |