BuilderCommandProvider.php 994 B

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