BuilderCommandProvider.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. declare(strict_types = 1);
  3. namespace Fgm\Drupal\Composer;
  4. use Composer\Plugin\Capability\CommandProvider;
  5. /**
  6. * Command capability for Composer plugins: provides the list of commmands.
  7. *
  8. * @package Fgm\Drupal\Composer
  9. */
  10. class BuilderCommandProvider implements CommandProvider {
  11. /**
  12. * The currently running Composer instance.
  13. *
  14. * @var \Composer\Composer
  15. */
  16. protected $composer;
  17. /**
  18. * The Composer I/O.
  19. *
  20. * @var \Composer\IO\IOInterface
  21. */
  22. protected $io;
  23. /**
  24. * An instance of the plugin instantiated not-as-a-command.
  25. *
  26. * @var self
  27. */
  28. protected $plugin;
  29. /**
  30. * BuilderCommandProvider constructor.
  31. *
  32. * @param array|null $args
  33. * Guaranteed to contain composer/io/plugin as per CommandProvider.
  34. */
  35. public function __construct(array $args = NULL) {
  36. $this->composer = $args['composer'];
  37. $this->io = $args['io'];
  38. $this->plugin = $args['plugin'];
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function getCommands() {
  44. return [
  45. new BuildSettingsCommand(),
  46. new HugoConfigCommand(),
  47. new MergeParamsCommand(),
  48. ];
  49. }
  50. }