Skip to content

Commit

Permalink
Removing global events and event base class
Browse files Browse the repository at this point in the history
  • Loading branch information
mvriel committed Jul 28, 2015
1 parent 762722d commit 83bee87
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 819 deletions.
176 changes: 0 additions & 176 deletions src/phpDocumentor/Application/Cli/Command/Helper/LoggerHelper.php

This file was deleted.

20 changes: 0 additions & 20 deletions src/phpDocumentor/Application/Cli/Command/RunCommand.php
Expand Up @@ -25,9 +25,7 @@
use phpDocumentor\Descriptor\FileDescriptor;
use phpDocumentor\Descriptor\ProjectDescriptor;
use phpDocumentor\Descriptor\Validator\Error;
use phpDocumentor\Event\DebugEvent;
use phpDocumentor\Event\Dispatcher;
use phpDocumentor\Event\LogEvent;
use phpDocumentor\Renderer\RenderActionCompleted;
use phpDocumentor\Parser\Backend\Php;
use phpDocumentor\Parser\Event\PreFileEvent;
Expand Down Expand Up @@ -321,24 +319,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
private function attachListeners(InputInterface $input, OutputInterface $output)
{
if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) {
Dispatcher::getInstance()->addListener(
'system.log',
function (LogEvent $event) use ($output) {
$output->writeln(' <comment>-- ' . trim($event->getMessage()) . '</comment>');
}
);
}

if ($output->getVerbosity() === OutputInterface::VERBOSITY_DEBUG) {
Dispatcher::getInstance()->addListener(
'system.debug',
function (DebugEvent $event) use ($output) {
$output->writeln(' <comment>-- ' . trim($event->getMessage()) . '</comment>');
}
);
}

$this->emitter->addListener(
RenderActionCompleted::class,
function ($event) use ($output) {
Expand Down
3 changes: 1 addition & 2 deletions src/phpDocumentor/Application/Commands/TransformHandler.php
Expand Up @@ -15,7 +15,6 @@
use League\Event\Emitter;
use League\Tactician\CommandBus;
use phpDocumentor\Dsn;
use phpDocumentor\Event\Dispatcher;
use phpDocumentor\FilesystemFactory;
use phpDocumentor\Path;
use phpDocumentor\Renderer\TemplateFactory;
Expand All @@ -35,7 +34,7 @@ final class TransformHandler
/** @var FilesystemFactory */
private $filesystemFactory;

/** @var Dispatcher */
/** @var Emitter */
private $emitter;

public function __construct(
Expand Down
3 changes: 0 additions & 3 deletions src/phpDocumentor/ContainerDefinitions.php
Expand Up @@ -16,7 +16,6 @@
use League\Tactician\Handler\MethodNameInflector\MethodNameInflector;
use phpDocumentor\Application\Cli\Command\ListCommand;
use phpDocumentor\Application\CommandBus\ContainerLocator;
use phpDocumentor\Application\Cli\Command\Helper\LoggerHelper;
use phpDocumentor\Application\Cli\Command\Phar\UpdateCommand;
use phpDocumentor\Application\Cli\Command\RunCommand;
use phpDocumentor\Compiler\Compiler;
Expand Down Expand Up @@ -141,8 +140,6 @@
)
);

$application->getHelperSet()->set($c->get(LoggerHelper::class));

$application->add($c->get(RunCommand::class));
$application->add($c->get(ListCommand::class));
if (\Phar::running()) {
Expand Down
90 changes: 0 additions & 90 deletions src/phpDocumentor/Event/DebugEvent.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/phpDocumentor/Event/Dispatcher.php
Expand Up @@ -78,7 +78,7 @@ public static function setInstance($name, self $instance)
*
* @codeCoverageIgnore Untestable and not really necessary
*
* @return EventAbstract
* @return Event
*/
public function dispatch($eventName, Event $event = null)
{
Expand Down

0 comments on commit 83bee87

Please sign in to comment.