DependsCommand.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Command;
  12. use Symfony\Component\Console\Input\InputInterface;
  13. use Symfony\Component\Console\Output\OutputInterface;
  14. /**
  15. * @author Niels Keurentjes <niels.keurentjes@omines.com>
  16. */
  17. class DependsCommand extends BaseDependencyCommand
  18. {
  19. /**
  20. * Configure command metadata.
  21. */
  22. protected function configure()
  23. {
  24. parent::configure();
  25. $this
  26. ->setName('depends')
  27. ->setAliases(array('why'))
  28. ->setDescription('Shows which packages cause the given package to be installed.')
  29. ->setHelp(
  30. <<<EOT
  31. Displays detailed information about where a package is referenced.
  32. <info>php composer.phar depends composer/composer</info>
  33. Read more at https://getcomposer.org/doc/03-cli.md#depends-why-
  34. EOT
  35. )
  36. ;
  37. }
  38. /**
  39. * Execute the function.
  40. *
  41. * @param InputInterface $input
  42. * @param OutputInterface $output
  43. * @return int|null
  44. */
  45. protected function execute(InputInterface $input, OutputInterface $output)
  46. {
  47. return parent::doExecute($input, $output, false);
  48. }
  49. }