From dbcf8cae1384dfc5acab5ec1d07d43580d326a48 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 19 Nov 2015 17:42:08 +0000 Subject: [PATCH] Fix depends command to also show when the root package depends on something --- src/Composer/Command/DependsCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/DependsCommand.php b/src/Composer/Command/DependsCommand.php index b4017c2fe..ef0f36e4d 100644 --- a/src/Composer/Command/DependsCommand.php +++ b/src/Composer/Command/DependsCommand.php @@ -13,6 +13,8 @@ namespace Composer\Command; use Composer\DependencyResolver\Pool; +use Composer\Repository\ArrayRepository; +use Composer\Repository\CompositeRepository; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Symfony\Component\Console\Input\InputInterface; @@ -57,7 +59,10 @@ EOT $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'depends', $input, $output); $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); - $repo = $composer->getRepositoryManager()->getLocalRepository(); + $repo = new CompositeRepository(array( + new ArrayRepository(array($composer->getPackage())), + $composer->getRepositoryManager()->getLocalRepository(), + )); $needle = $input->getArgument('package'); $pool = new Pool();