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; }