BuilderCommandProvider.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 BuildServicesCommand(),
  46. new BuildSettingsCommand(),
  47. new HugoConfigCommand(),
  48. new MergeParamsCommand(),
  49. new PhpMemcacheAdminConfigCommand(),
  50. ];
  51. }
  52. }