From 2b5a9aee6c780a8ab62f5f7d582fb15d4fd94883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Scho=CC=88nthal?= Date: Fri, 31 Jan 2014 22:09:55 +0100 Subject: [PATCH] some tiny refactorings --- src/Composer/Command/HomeCommand.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Composer/Command/HomeCommand.php b/src/Composer/Command/HomeCommand.php index 2192af147..550f06308 100644 --- a/src/Composer/Command/HomeCommand.php +++ b/src/Composer/Command/HomeCommand.php @@ -15,8 +15,7 @@ namespace Composer\Command; use Composer\DependencyResolver\Pool; use Composer\Factory; use Composer\Package\CompletePackageInterface; -use Composer\Plugin\CommandEvent; -use Composer\Plugin\PluginEvents; +use Composer\Package\Loader\InvalidPackageException; use Composer\Repository\CompositeRepository; use Composer\Repository\RepositoryInterface; use Symfony\Component\Console\Input\InputArgument; @@ -63,7 +62,7 @@ EOT $url = isset($support['source']) ? $support['source'] : $package->getSourceUrl(); $this->openBrowser($url); } else { - $output->writeln('no valid source-url given for ' . $package->getName()); + throw new InvalidPackageException(array($package->getName() => 'invalid source-url')); } } @@ -135,13 +134,6 @@ EOT $repo = new CompositeRepository($defaultRepos); } - if ($composer) { - $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'home', $input, $output); - $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); - - return $repo; - } - return $repo; }