composer = $composer; } /** * {@inheritdoc} */ public function uninstall(Composer $composer, IOInterface $io): void { /** @var string $vendorDirectory */ $vendorDirectory = $composer->getConfig()->get('vendor-dir'); $pluginFile = sprintf('%s/%s', $vendorDirectory, self::PLUGIN_CACHE_FILE); if (file_exists($pluginFile)) { unlink($pluginFile); } } /** * {@inheritdoc} * * @return array */ public static function getSubscribedEvents() { return [ 'post-autoload-dump' => 'registerPlugins', ]; } public function getCapabilities() { return [ \Composer\Plugin\Capability\CommandProvider::class => PestCommandProvider::class, ]; } public function registerPlugins(): void { $cmd = new DumpCommand; $cmd->setComposer($this->composer); $cmd->run(new ArrayInput([]), new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, true)); } /** {@inheritdoc} */ public function deactivate(Composer $composer, IOInterface $io): void {} }