CommandList.php 649 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Console;
  7. /**
  8. * Class CommandList has a list of commands, which can be extended via DI configuration.
  9. */
  10. class CommandList implements CommandListInterface
  11. {
  12. /**
  13. * @var string[]
  14. */
  15. protected $commands;
  16. /**
  17. * Constructor
  18. *
  19. * @param array $commands
  20. */
  21. public function __construct(array $commands = [])
  22. {
  23. $this->commands = $commands;
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function getCommands()
  29. {
  30. return $this->commands;
  31. }
  32. }